System.exit(0);是系统关闭,也就是你的平台虽然关闭了,但在你的内存还是占有着,
dispose();是释放资源,也就将你的平台从内存中释放!(建议用这种)
main中加入thisClass.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
thisClass.setVisible(true); 正常的关闭
当通过一个窗体打开另一个窗体 关闭第二个窗体内存经常会没有释放 所以在initialize() 中加入this.addWindowListener(new java.awt.event.WindowAdapter() {
public void windowClosing(java.awt.event.WindowEvent e) {
System.exit(0);
}
});关窗体除内存