4
我有这样的代码片段没有按钮:如何改变是文本/ JavaFX的8警报对话框
Alert alert =
new Alert(AlertType.WARNING,
"The format for dates is year.month.day. " +
"For example, today is " + todayToString() + ".",
ButtonType.OK,
ButtonType.CANCEL);
alert.setTitle("Date format warning");
Optional<ButtonType> result = alert.showAndWait();
if (result.get() == ButtonType.OK) {
formatGotIt = true;
}
上面,我要求两个按钮标题为“是”和“否”。但是,我希望对它们进行更改。