[求助]关于窗口关闭事件
我写了如下代码,但是窗体还是会关闭
怎样才能使窗口在选择“否”时 不关闭 然后返回界面呢?
public void this_windowClosing(WindowEvent e) {
if(JOptionPane.showConfirmDialog(this,"Are you sure to exit?","Exit Confirm",JOptionPane.YES_NO_OPTION,JOptionPane.QUESTION_MESSAGE) == JOptionPane.YES_OPTION)
{
System.exit(0);
}
}