本文整理了Java中javafx.scene.control.Alert.setResizable()
方法的一些代码示例,展示了Alert.setResizable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Alert.setResizable()
方法的具体详情如下:
包路径:javafx.scene.control.Alert
类名称:Alert
方法名:setResizable
暂无
代码示例来源:origin: stackoverflow.com
Alert dialog = new Alert(Alert.AlertType.ERROR);
dialog.setHeaderText("Connection Failed");
dialog.setContentText(this.getException().getMessage());
//FIXME: Remove after release 8u40
dialog.setResizable(true);
dialog.getDialogPane().setPrefSize(480, 320);
dialog.showAndWait();
代码示例来源:origin: com.powsybl/powsybl-gse-util
public static void showDialogError(String message) {
Alert alert = new Alert(Alert.AlertType.ERROR);
alert.setTitle(GSE_ERROR);
alert.setResizable(true);
alert.setContentText(message);
alert.showAndWait();
}
代码示例来源:origin: stackoverflow.com
ButtonType queen = new ButtonType("Queen");
ButtonType rook = new ButtonType("Rook");
Alert a = new Alert(AlertType.NONE, "Promote pawn to:", queen, rook);
a.setTitle("Title");
a.setHeaderText("My header text");
a.setResizable(true);
a.setContentText("Content text");
a.showAndWait().ifPresent(response -> {
if (response == queen) {
// promote to queen...
} else if (response == rook) {
// promote to rook...
}
});
代码示例来源:origin: org.tentackle/tentackle-fx
/**
* Workaround for the bug that messages are not completely displayed if text is wrapped.
*
* @param alert the alert dialog
* @param message the text message
*/
protected void setAlertMessage(Alert alert, String message) {
alert.setHeaderText(null);
Label textLabel = new Label(); // replace with non-wrapping label!
textLabel.setWrapText(false);
textLabel.setText(message);
alert.getDialogPane().setContent(textLabel);
alert.setResizable(true); // RT-38998
}
内容来源于网络,如有侵权,请联系作者删除!