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