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

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

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

Alert.setGraphic介绍

暂无

代码示例

代码示例来源:origin: speedment/speedment

@Override
public Optional<ButtonType> showWarning(String title, String message) {
  final Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
  final Scene scene = alert.getDialogPane().getScene();
  BrandUtil.applyBrand(injector, stage, scene);
  alert.setTitle("Confirmation");
  alert.setHeaderText(title);
  alert.setContentText(message);
  alert.setGraphic(FontAwesome.EXCLAMATION_TRIANGLE.view());
  return alert.showAndWait();
}

代码示例来源:origin: speedment/speedment

alert.setGraphic(FontAwesome.EXCLAMATION_TRIANGLE.view());
alert.getDialogPane().setMinHeight(Region.USE_PREF_SIZE);

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

@FXML void handleHelpButton(ActionEvent event){
   Alert alert = new Alert(AlertType.INFORMATION);
   alert.setTitle("Help");
   alert.setHeaderText("Help");
   alert.setGraphic(new ImageView(this.getClass().getResource("img/help.png").toString()));
   alert.setContentText("Place the cursor over a button for hint.");
   Stage stage = (Stage) alert.getDialogPane().getScene().getWindow();
   stage.getIcons().add(new Image(this.getClass().getResource("img/help.png").toString()));        
   alert.showAndWait();
 }

相关文章