diff --git a/src/main/java/ChatClient.java b/src/main/java/ChatClient.java index 0179d4c..44a0bc6 100644 --- a/src/main/java/ChatClient.java +++ b/src/main/java/ChatClient.java @@ -15,6 +15,7 @@ public class ChatClient extends JFrame implements KeyListener { // GUI private JTextArea outputTextArea; private JTextField inputTextField; + private JScrollPane outputScrollPane; public ChatClient(int port) { super("Chat"); @@ -31,11 +32,13 @@ public class ChatClient extends JFrame implements KeyListener { outputTextArea.setEditable(false); outputTextArea.setBorder(BorderFactory.createTitledBorder("Chat")); + outputScrollPane = new JScrollPane(outputTextArea); + inputTextField = new JTextField(); inputTextField.setBorder(BorderFactory.createTitledBorder("Nachricht eingeben")); inputTextField.addKeyListener(this); - add(outputTextArea, BorderLayout.CENTER); + add(outputScrollPane, BorderLayout.CENTER); add(inputTextField, BorderLayout.SOUTH); setVisible(true);