@FXML public void newUser(Event evt) throws SQLException, RemoteException { if (tfNewUserUsername.getText().equals("") || tfNewUserPassword.getText().equals("")) { Alert alert = new Alert(AlertType.INFORMATION); alert.setTitle("Information Dialog"); alert.setHeaderText("Please fill in username and password"); alert.showAndWait(); } else { loginIn.registerUser(tfNewUserUsername.getText(), tfNewUserPassword.getText()); Alert alert = new Alert(AlertType.INFORMATION); alert.setTitle("Information"); alert.setHeaderText(null); alert.setContentText( tfNewUserUsername.getText() + " your account has been succesfully created"); alert.showAndWait(); } }