|
@ -1,4 +1,5 @@ |
|
|
import javax.swing.*; |
|
|
import javax.swing.*; |
|
|
|
|
|
import java.awt.*; |
|
|
import java.io.IOException; |
|
|
import java.io.IOException; |
|
|
import java.net.Socket; |
|
|
import java.net.Socket; |
|
|
|
|
|
|
|
@ -23,10 +24,13 @@ public class ChatClient extends JFrame { |
|
|
|
|
|
|
|
|
private void initGui() { |
|
|
private void initGui() { |
|
|
outputTextArea = new JTextArea(); |
|
|
outputTextArea = new JTextArea(); |
|
|
|
|
|
outputTextArea.setBorder(BorderFactory.createTitledBorder("Chat")); |
|
|
|
|
|
|
|
|
inputTextField = new JTextField(); |
|
|
inputTextField = new JTextField(); |
|
|
|
|
|
inputTextField.setBorder(BorderFactory.createTitledBorder("Nachricht eingeben")); |
|
|
|
|
|
|
|
|
add(outputTextArea); |
|
|
|
|
|
add(inputTextField); |
|
|
|
|
|
|
|
|
add(outputTextArea, BorderLayout.CENTER); |
|
|
|
|
|
add(inputTextField, BorderLayout.SOUTH); |
|
|
|
|
|
|
|
|
setVisible(true); |
|
|
setVisible(true); |
|
|
setSize(800, 600); |
|
|
setSize(800, 600); |
|
|