Browse Source

refactoring: EmojiPicker4

remotes/origin/client-handler
Valentin Spiroski 11 months ago
parent
commit
91279d4835
  1. 13
      src/main/java/EmojiPicker.java

13
src/main/java/EmojiPicker.java

@ -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);
}
}

Loading…
Cancel
Save