@FXML private void handleExitAction(ActionEvent event) { final Stage owner = (Stage) ((Node) event.getSource()).getScene().getWindow(); Dialog.showYesNo( "ΕΞΟΔΟΣ ΕΦΑΡΜΟΓΗΣ!", "Θέλετε να κλείσετε την εφαρμογή;\n\n", owner, new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent t) { try { owner.close(); } catch (Exception ex) { System.out.println("wrong uri again ><"); // TODO handle error loading stage } } }, new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent t) { // Keep running } }); }
@FXML private void handleInstructionsAction(ActionEvent event) { instructions(); Stage owner = (Stage) ((Node) event.getSource()).getScene().getWindow(); Dialog.showInfo( "ΟΔΗΓΙΕΣ ΠΑΙΧΝΙΔΙΟΥ!", instructionsText, owner, new EventHandler<ActionEvent>() { @Override public void handle(ActionEvent t) { // Keep running } }); }