我有一个 JOptionPane 和是和否按钮。但是,无论您单击哪个按钮,它仍然存在。帮助!继承人的代码:
int dialogButton = JOptionPane.YES_NO_OPTION;
JOptionPane.showConfirmDialog (null, "Are you sure?","WARNING", dialogButton);
if(dialogButton == JOptionPane.YES_OPTION) {
System.exit(0);
if(dialogButton == JOptionPane.NO_OPTION) {
remove(dialogButton);
}
}