我想将"is"和“否”更改为“同意/不同意”之类的内容。 我该怎么办?
int reply = JOptionPane.showConfirmDialog(null,
"Are you want to continue the process?",
"YES?",
JOptionPane.YES_NO_OPTION);
最佳答案
您可以执行以下操作
JFrame frame = new JFrame();
String[] options = new String[2];
options[0] = "Agree";
options[1] = "Disagree";
JOptionPane.showOptionDialog(frame.getContentPane(), "Message!", "Title", 0, JOptionPane.INFORMATION_MESSAGE, null, options, null);
输出如下
有关 showOptionDialog() 函数的更多详细信息,请参阅 here .
关于java - 如何更改确认对话框中的是/否选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18286027/