Browse Source

Close messaging window if the connection is broken

remotes/origin/feature/client/exchange-messages-between-client-server
Alena Bandarovich 11 months ago
parent
commit
50b3994180
  1. 2
      src/main/java/ChatClient.java

2
src/main/java/ChatClient.java

@ -60,6 +60,7 @@ public class ChatClient extends JFrame implements KeyListener {
} }
} catch (IOException e) { } catch (IOException e) {
JOptionPane.showMessageDialog(null, "Verbindung zum Server \"" + address + "\" fehlgeschlagen."); JOptionPane.showMessageDialog(null, "Verbindung zum Server \"" + address + "\" fehlgeschlagen.");
dispose();
} finally { } finally {
if (null != connectionToServer) { if (null != connectionToServer) {
try { try {
@ -80,7 +81,6 @@ public class ChatClient extends JFrame implements KeyListener {
if(null != toServerWriter) { if(null != toServerWriter) {
toServerWriter.close(); toServerWriter.close();
} }
} }
} }

Loading…
Cancel
Save