增加这么个方法
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
int choose = JOptionPane.showConfirmDialog(this,"退出?","警告",JOptionPane.OK_CANCEL_OPTION);
if(choose==2){
return;
}else{
this.dispose();
}
}
protected void processWindowEvent(WindowEvent e) {
super.processWindowEvent(e);
if (e.getID() == WindowEvent.WINDOW_CLOSING) {
int choose = JOptionPane.showConfirmDialog(this,"退出?","警告",JOptionPane.OK_CANCEL_OPTION);
if(choose==2){
return;
}else{
this.dispose();
}
}
解决方案 »
- 请教一个奇怪的问题
- 怎么用while语句实现因数分解,刚学 不懂哦
- java进程与vc进程间通讯有些什么方法?
- 大虾帮我看看这个问题。谢谢了!!!!!!!!!!!
- jdk1.7的一些疑问
- 可以用jcreator编译和执行,但是在DOS下却只能执行,不能编译,怎么了?
- 经常看到“链接池”这个词,到底是什么意思,作什么用的??
- 请各位帮忙看一下这个有趣的问题!
- How can I convert a Char type to a Integer type?
- 紧急!为什么我的applet不能够连接oracle数据库。我用的JDBC,提示找不到JDBC类。应该如何配置服务器啊
- 求助:SQL Server 2000的jdbc的url怎么写?
- instance 和 object 的区别?
多谢二位大侠!