|
|
@ -33,10 +33,17 @@ public class EmojiPicker extends JPanel { |
|
|
|
setPreferredSize(new Dimension(300, 200)); // Set preferred size for the EmojiPicker panel |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
* ActionListener for handling emoji button clicks. |
|
|
|
*/ |
|
|
|
private class EmojiActionListener implements ActionListener { |
|
|
|
|
|
|
|
private String emoji; |
|
|
|
private String emoji; // Selected emoji |
|
|
|
|
|
|
|
/** |
|
|
|
* Constructs an EmojiActionListener with the specified emoji. |
|
|
|
* @param emoji The emoji associated with this listener. |
|
|
|
*/ |
|
|
|
|
|
|
|
public EmojiActionListener(String emoji) { |
|
|
|
this.emoji = emoji; |
|
|
@ -44,7 +51,7 @@ public class EmojiPicker extends JPanel { |
|
|
|
|
|
|
|
@Override |
|
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
System.out.println("Selected emoji: " + emoji); |
|
|
|
System.out.println("Selected emoji: " + emoji); |
|
|
|
textField.setText(textField.getText() + emoji); |
|
|
|
} |
|
|
|
} |
|
|
|