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;
}
上面,我要求兩個按鈕標題爲「是」和「否」。但是,我希望對它們進行更改。