Browse Source

Emoji in ChatClient

remotes/origin/client-handler
Valentin Spiroski 11 months ago
parent
commit
74851c0fa0
  1. 11
      src/main/java/ChatClient.java

11
src/main/java/ChatClient.java

@ -77,6 +77,10 @@ public class ChatClient extends JFrame implements KeyListener {
private Timer timer; private Timer timer;
private JLabel timeLabel; private JLabel timeLabel;
private JButton emojiButton;
private EmojiPicker emojiPicker;
public ChatClient() { public ChatClient() {
super("Chat"); super("Chat");
address = JOptionPane.showInputDialog("bitte IP-Adresse"); address = JOptionPane.showInputDialog("bitte IP-Adresse");
@ -118,8 +122,13 @@ public class ChatClient extends JFrame implements KeyListener {
inputTextField.setBorder(BorderFactory.createTitledBorder("Nachricht eingeben")); inputTextField.setBorder(BorderFactory.createTitledBorder("Nachricht eingeben"));
inputTextField.addKeyListener(this); inputTextField.addKeyListener(this);
JPanel inputPanel = new JPanel(new BorderLayout());
inputPanel.add(inputTextField, BorderLayout.CENTER);
emojiPicker = new EmojiPicker(inputTextField);
add(outputScrollPane, BorderLayout.CENTER); add(outputScrollPane, BorderLayout.CENTER);
add(inputTextField, BorderLayout.SOUTH);
add(inputTextField, BorderLayout.PAGE_END);
setVisible(true); setVisible(true);
setSize(Constants.WINDOW_WIDTH, Constants.WINDOW_HEIGHT); setSize(Constants.WINDOW_WIDTH, Constants.WINDOW_HEIGHT);

Loading…
Cancel
Save