JavaFX 警报对话框

问题描述

我正在尝试在 javaFX 中制作警报弹出窗口。但是,我可以看到英文的 OK 按钮,但 CANCEL 按钮是用韩文表示的,例如 this。请让我知道如何用英语制作取消按钮。 这是我的代码的一部分:

Alert alert = new Alert(Alert.AlertType.CONFIRMATION);
alert.setTitle("Message");
alert.setHeaderText("Are you sure you want to clear all nodes?");
Optional<ButtonType> result = alert.showAndWait();
if (result.get().equals(ButtonType.OK)) { 
       gc.clearRect(0,canvas.getWidth(),canvas.getHeight());
       bst.clear(); 
       height = 20;
       width = 740;
       ratiowidth = 740;
}else if (result.get().equals(ButtonType.NO)) {
       alert.close();
}

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)