From 74851c0fa03c9708d443c7dad40e580af7cfb01a Mon Sep 17 00:00:00 2001 From: Valentin Spiroski Date: Fri, 9 Feb 2024 21:34:17 +0100 Subject: [PATCH] Emoji in ChatClient --- src/main/java/ChatClient.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/ChatClient.java b/src/main/java/ChatClient.java index 7ff74a6..bbfc218 100644 --- a/src/main/java/ChatClient.java +++ b/src/main/java/ChatClient.java @@ -77,6 +77,10 @@ public class ChatClient extends JFrame implements KeyListener { private Timer timer; private JLabel timeLabel; + private JButton emojiButton; + private EmojiPicker emojiPicker; + + public ChatClient() { super("Chat"); address = JOptionPane.showInputDialog("bitte IP-Adresse"); @@ -118,8 +122,13 @@ public class ChatClient extends JFrame implements KeyListener { inputTextField.setBorder(BorderFactory.createTitledBorder("Nachricht eingeben")); inputTextField.addKeyListener(this); + JPanel inputPanel = new JPanel(new BorderLayout()); + inputPanel.add(inputTextField, BorderLayout.CENTER); + emojiPicker = new EmojiPicker(inputTextField); + + add(outputScrollPane, BorderLayout.CENTER); - add(inputTextField, BorderLayout.SOUTH); + add(inputTextField, BorderLayout.PAGE_END); setVisible(true); setSize(Constants.WINDOW_WIDTH, Constants.WINDOW_HEIGHT);