System.exit(1);
或者使用事件
按收事件来关闭窗体
或者使用事件
按收事件来关闭窗体
解决方案 »
- 关于form表单提交的方式
- [紧急]Hibernate3.5 如何转换下列SQL 到 HQL ?
- hibernate映射问题
- jsp:forward 问题
- 如何通过JDBC(jtds-1.2.jar)直接连接,将500M的文本文件(D:\\abc.txt)写入MS SQL2000的text类型字段
- Struts+Hibernate模糊查询问题
- HTTP Status 500 这是怎么了?
- 用过struts的高手,请进
- Maven Build报错:Failed to execute goal org.apache.maven.plugins:maven-surefire-plu
- 自学spring第一个程序就有问题求解,本人小白,欢迎大神讲解!
- 高薪招聘高级JAVA程序员
- 在Struts 的模块里使用标签报错??
{
public static void main(String[] args)
{
SimpleFrame frame = new SimpleFrame();
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frame.show();
}
}class SimpleFrame extends JFrame
{
public SimpleFrame()
{
setSize(WIDTH, HEIGHT);
} public static final int WIDTH = 300;
public static final int HEIGHT = 200;
}
楼主要求也太高了吧,上面那位的代码已经很精练了啊.我在jb里只拖拉了一点swing控件,设置了一些属性,JBuilder自动生成的代码居然接近了1000行.
frame.addWindowListener(new WindowAdapter()
{
{public void widowClosing(WindowEvent e)
{System.exit(0);}
});
}
或者继承Adapter
class Frame extends WindowAdapter
{
Frame f = new Frame();
f.addwindowListener(this);
public void WindowClosing(WindowEvent e)
{
System.exit(0);
}
}