我需要在 showConfirmDialog
中只有一个按钮。
我尝试过这样:
int response = JOptionPane.showConfirmDialog(null, "Time Entered Successfully",
"", JOptionPane.OK_OPTION, JOptionPane.PLAIN_MESSAGE);
if (response == JOptionPane.CLOSED_OPTION || response == JOptionPane.OK_OPTION)
{
System.out.println("CLOSING>>>>>>");
}
但是这个显示了一个带有“是”和“否”选项的对话框。
我只想让它显示“确定”按钮。这可行吗?