|
@ -47,7 +47,17 @@ public class ChatClient extends JFrame implements KeyListener { |
|
|
try { |
|
|
try { |
|
|
connectionToServer = new Socket(address, port); |
|
|
connectionToServer = new Socket(address, port); |
|
|
initGui(); |
|
|
initGui(); |
|
|
} catch (Exception e) { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// while (true) { |
|
|
|
|
|
// String message = fromServerReader.readLine(); |
|
|
|
|
|
// outputTextArea.append(message + "\n"); |
|
|
|
|
|
// } |
|
|
|
|
|
// Solang fromServerReader nicht erstellt ist als Kommentar |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
catch (Exception e) { |
|
|
JOptionPane.showMessageDialog(null, "Verbindung zum Server \"" + address + "\" fehlgeschlagen."); |
|
|
JOptionPane.showMessageDialog(null, "Verbindung zum Server \"" + address + "\" fehlgeschlagen."); |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|