Browse Source

A few bug fixes

cam
Cameron Weinfurt 2 years ago
parent
commit
49fffa744a
  1. 6
      proto/ProtoIn.java
  2. 2
      window/LoginWindow.java

6
proto/ProtoIn.java

@ -99,11 +99,7 @@ public class ProtoIn
Thread t = new Thread(() -> handler.handleUnknownCommand(length, id, username));
t.start();
}
} catch (EOFException e)
{
this.loop = false;
handler.handleClose();
} catch (SocketException e)
} catch (EOFException | SocketException e)
{
this.loop = false;
handler.handleClose();

2
window/LoginWindow.java

@ -59,6 +59,7 @@ public class LoginWindow extends Application {
ChatWindow chatWindow = new ChatWindow(servernameAndPort[0], usernameTextField.getText(), socket, this);
Stage chatWindowStage = new Stage();
chatWindow.start(chatWindowStage);
stage.hide();
}
} catch (NumberFormatException nfe) {
Alert alert = new Alert(Alert.AlertType.ERROR);
@ -78,7 +79,6 @@ public class LoginWindow extends Application {
} catch (IOException e) {
e.printStackTrace();
}
stage.hide();
});
root.getChildren().addAll(servernameLabel, servernameTextField, usernameLabel, usernameTextField, connectButton);

Loading…
Cancel
Save