javafx.scene.control.Alert.close()方法的使用及代码示例

x33g5p2x  于2022-01-16 转载在 其他  
字(1.5k)|赞(0)|评价(0)|浏览(174)

本文整理了Java中javafx.scene.control.Alert.close()方法的一些代码示例,展示了Alert.close()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alert.close()方法的具体详情如下:
包路径:javafx.scene.control.Alert
类名称:Alert
方法名:close

Alert.close介绍

暂无

代码示例

代码示例来源:origin: stackoverflow.com

timeOut.getKeyFrames().add(
  new KeyFrame(Duration.seconds(1.5), 
     e->alertOut.close(),
     new KeyValue(yPropertyOut, yIni,Interpolator.EASE_BOTH)));
timeOut.play();
alertOut.close();
primaryStage.close();

代码示例来源:origin: stackoverflow.com

observablePlantList.remove(selectedPlant);
} else {
  alertBox.close();

代码示例来源:origin: com.powsybl/powsybl-gse-afs-ext-base

private void showRemoveAlert() {
  ObservableList<TreeItem<Object>> selectedItems = contingencyTree.getSelectionModel().getSelectedItems();
  Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
  alert.setTitle(REMOVE);
  if (selectedItems.size() == 1) {
    TreeItem<Object> item = selectedItems.get(0);
    if (item.getValue() instanceof Contingency) {
      alert.setHeaderText(REMOVE + " " + ((Contingency) item.getValue()).getId() + " ?");
    } else if (item.getValue() instanceof ContingencyElement) {
      alert.setHeaderText(REMOVE + " " + ((ContingencyElement) item.getValue()).getId() + " ?");
    }
  } else {
    alert.setHeaderText(REMOVE + " " + RESOURCE_BUNDLE.getString("SelectedElements") + " ?");
  }
  Optional<ButtonType> result = alert.showAndWait();
  result.ifPresent(type -> {
    if (type == ButtonType.OK) {
      remove();
    } else {
      alert.close();
    }
  });
}

相关文章