示例#1
0
 public static void showInfoPopup(String title, String header, String content) {
   Alert alert = new Alert(Alert.AlertType.INFORMATION);
   alert.setTitle(title);
   alert.setHeaderText(header);
   alert.setContentText(content);
   alert.show();
 }
示例#2
0
 public static void showWarningPopup(String title, String header, String content) {
   Alert alert = new Alert(Alert.AlertType.WARNING);
   alert.setTitle(title);
   alert.setHeaderText(header);
   alert.setContentText(content);
   alert.show();
 }
示例#3
0
 public static void showErrorDialog(String header, String content) {
   Alert alert = new Alert(Alert.AlertType.ERROR);
   alert.setTitle(ResourceManager.getMessage("title.dialog.error"));
   alert.setHeaderText(header);
   alert.setContentText(content);
   alert.showAndWait();
 }
示例#4
0
  public static boolean showConfirmPopup(
      Node graphic, String title, String header, String content) {
    Alert alert = new Alert(Alert.AlertType.CONFIRMATION, content, ButtonType.YES, ButtonType.NO);
    if (graphic != null) {
      alert.setGraphic(graphic);
    }
    alert.setTitle(title);
    alert.setHeaderText(header);

    Optional<ButtonType> result = alert.showAndWait();
    return result.get() == ButtonType.YES;
  }