From 4a36e33afa04c5634e3d1eeb397e1f589e7d6a20 Mon Sep 17 00:00:00 2001 From: Valentin Spiroski Date: Fri, 9 Feb 2024 20:25:41 +0100 Subject: [PATCH] for loop in EmojiPicker --- src/main/java/EmojiPicker.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/main/java/EmojiPicker.java b/src/main/java/EmojiPicker.java index c641c38..73bb1db 100644 --- a/src/main/java/EmojiPicker.java +++ b/src/main/java/EmojiPicker.java @@ -13,7 +13,12 @@ public class EmojiPicker extends JPanel { setLayout(new GridLayout(4, 3, 5, 5)); - + for (String emoji : emojis) { + JButton emojiButton = new JButton(emoji); + emojiButton.setFont(new Font("Segoe UI Emoji", Font.PLAIN, 20)); + emojiButton.addActionListener(new EmojiActionListener(emoji)); + add(emojiButton); + } setPreferredSize(new Dimension(300, 200));