我正在尝试制作一个对话框,当用户单击“否”或“取消”时将关闭该对话框,并且当他们单击“是”时脚本将继续,但由于某种原因,我无法让下面的代码工作。
this.finish(); Process.killProcess( Process.myPid() );
//default title and icon
int dialogButton= JOptionPane.YES_NO_CANCEL_OPTION;
int dialogResult = JOptionPane.showConfirmDialog(null, "do you plan on attending a local technology center?", "Info",dialogButton);
if(dialogResult==JOptionPane.YES_OPTION){
//Code for YES Button Clicked
}
else if(dialogResult==JOptionPane.NO_OPTION)
{
//Code for NO Button Clicked
this.finish(); Process.killProcess( Process.myPid() );
}
else if(dialogResult==JOptionPane.CANCEL_OPTION){
//Code for CANCEL Button Clicked
this.finish(); Process.killProcess( Process.myPid() );
}