关闭代码如下:
private class MyWindowListener extends WindowAdapter{
public void windowsClosing(WindowEvent we){
JOptionPane.showConfirmDialog
(frame1,"退出","确认...",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE);
if(i==0){
System.exit(0);
}
}当关闭窗口时,询问框并未出现???,若删除应用程序,系统提示说"该程序仍在运行,无法删除...",不知何原因?
private class MyWindowListener extends WindowAdapter{
public void windowsClosing(WindowEvent we){
JOptionPane.showConfirmDialog
(frame1,"退出","确认...",JOptionPane.YES_NO_OPTION,JOptionPane.INFORMATION_MESSAGE);
if(i==0){
System.exit(0);
}
}当关闭窗口时,询问框并未出现???,若删除应用程序,系统提示说"该程序仍在运行,无法删除...",不知何原因?
frame.addWindowListener(MyWindowListener );