Пример #1
0
  private void showError(String error) {
    Alert alert = new Alert(Alert.AlertType.ERROR);
    alert.setTitle("Error");
    alert.setHeaderText("Uh oh...");
    alert.setContentText(error);

    alert.showAndWait();
  }
Пример #2
0
  private void endGame() {
    Alert alert = new Alert(Alert.AlertType.INFORMATION);
    alert.setTitle("Game Over");
    alert.setHeaderText("That's it, you failed");
    alert.setContentText("Score: -1");

    alert.setOnCloseRequest(e -> sm.setStage(StateManager.STATE_MENU));

    alert.showAndWait();
  }