From 783dcc256c2f8db7164aa41043860e386ce3390e Mon Sep 17 00:00:00 2001 From: Valentin Spiroski Date: Fri, 9 Feb 2024 22:03:15 +0100 Subject: [PATCH] refactoring: EmojiPicker2 --- src/main/java/EmojiPicker.java | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/main/java/EmojiPicker.java b/src/main/java/EmojiPicker.java index ad93e6a..8d9f330 100644 --- a/src/main/java/EmojiPicker.java +++ b/src/main/java/EmojiPicker.java @@ -3,15 +3,22 @@ import java.awt.*; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; +/** + * A panel containing a selection of emoji buttons to be used in conjunction with a JTextField. + */ + public class EmojiPicker extends JPanel { - private JTextField textField; + private JTextField textField; // Text field to append selected emoji + // Array containing a selection of emojis private static final String[] emojis = {"😀", "😃", "😄", "😁", "😆", "😅", "😂", "🤣", "😊", "😇", "🙂", "🙃"}; - - + /** + * Constructs an EmojiPicker with a specified JTextField. + * @param textField The JTextField to append selected emojis. + */ public EmojiPicker(JTextField textField) { setLayout(new GridLayout(4, 3, 5, 5));