JFrame jf1=new JFrame();
jf1.dispose();
jf1.dispose();
解决方案 »
- 数组问题
- 请问谁做过在linux下用java开发串口通信程序,所用第三方jar包是rxtx
- 奇怪的nullpointerexception,急!!帮忙看看,帮顶也有分!!!
- 请教窗口应用程序中java和gg map api 中事件的通信问题
- 静态内部类 有什么作用? 有那些应用?
- 有关Java画图,求教!
- 求一个可以伸缩界面的做法?
- 高分请求源程序!!
- 请问那里有TextPad4.5的注册码?
- 深入理解Java对象实例生成的例子
- 高分请教一些关于MVC模式的问题﹐关注有分﹐会再开贴子加分﹐加分无上限
- 请问哪位知道这句话的意思以及要导入哪些包? Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
public void windowClosing(WindowEvent e){
jf2.dispose();//关闭窗口的
}
});
可以使用setVisible(false);方法解决你的问题。
就是释放掉资源了
API:
Releases all of the native screen resources used by this Window, its subcomponents, and all of its owned children. That is, the resources for these Components will be destroyed, any memory they consume will be returned to the OS, and they will be ed as undisplayable.
operation的值有operation ==DO_NOTHING_ON_CLOSE
operation ==HIDE_ON_CLOSE
operation ==DISPOSE_ON_CLOSE
operation ==EXIT_ON_CLOSE
void jButton1_actionPerformed(ActionEvent e) {
setDefaultCloseOperation(EXIT_ON_CLOSE) ;
}是这样的吗? (还是关不了)