2
我試圖像他們在這個問題上 How can save some Objects, directly after the User has closed the Applications JFrame, but before the Program exits? 回答,但該框架將不會關閉如何退出前調用一個方法的JFrame與Java
我寫了下面的,但它是一回事,框架不會關閉。
@Override
public void windowClosed(WindowEvent e) {
dispose();
setVisible(false);
System.exit(0);
}
@Override
public void windowClosing(WindowEvent e) {
dispose();
setVisible(false);
System.exit(0);
}