Browse Source

Establish connection to server

remotes/origin/feature/client/exchange-messages-between-client-server
Alena Bandarovich 11 months ago
parent
commit
3f4a302efc
  1. 4
      src/main/java/ChatClient.java

4
src/main/java/ChatClient.java

@ -42,9 +42,7 @@ public class ChatClient extends JFrame implements KeyListener {
} }
private void receiveMessages() { private void receiveMessages() {
try { try {
// Um GUI zu testen
// Kommentar in der Zeile 28 wird weggenohmen, wenn der Server erstellt wird.
// connectionToServer = new Socket(address, port);
connectionToServer = new Socket(address, port);
initGui(); initGui();
} catch (Exception e) { } catch (Exception e) {
JOptionPane.showMessageDialog(null, "Verbindung zum Server \"" + address + "\" fehlgeschlagen."); JOptionPane.showMessageDialog(null, "Verbindung zum Server \"" + address + "\" fehlgeschlagen.");

Loading…
Cancel
Save