|
|
@ -20,7 +20,7 @@ public class ChatClient extends JFrame implements KeyListener { |
|
|
|
super("Chat"); |
|
|
|
address = JOptionPane.showInputDialog("bitte IP-Adresse"); |
|
|
|
|
|
|
|
if (address != null) { |
|
|
|
if (null != address) { |
|
|
|
receiveMessages(); |
|
|
|
} |
|
|
|
} |
|
|
@ -47,8 +47,8 @@ public class ChatClient extends JFrame implements KeyListener { |
|
|
|
private void receiveMessages() { |
|
|
|
try { |
|
|
|
connectionToServer = new Socket(address, Constants.PORT); |
|
|
|
fromServerReader = new BufferedReader(new InputStreamReader(connectionToServer.getInputStream())); |
|
|
|
toServerWriter = new PrintWriter(new OutputStreamWriter(connectionToServer.getOutputStream())); |
|
|
|
fromServerReader = new BufferedReader(new InputStreamReader(connectionToServer.getInputStream())); |
|
|
|
toServerWriter = new PrintWriter(new OutputStreamWriter(connectionToServer.getOutputStream())); |
|
|
|
|
|
|
|
initGui(); |
|
|
|
|
|
|
|