Swing代码分析(事件监听方法二)
2010-02-21 10:21
567 查看
]package nau.ui; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import javax.swing.JFrame; /** * 功能: * * @author wzj * */ public class SwingWinAdapterTestTool extends JFrame { /** * * */ public SwingWinAdapterTestTool() { this.setVisible(true); this.setTitle("SwingWinAdapterTestTool"); this.setBounds(100, 100, 400, 200); this.setLayout(null); // 窗口关闭时间失效 this.setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE); this.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.out.println("closing window"); // SwingWinAdapterTestTool.this.setVisible(true);// 刷新窗口 System.exit(0); } } ); } /** * * @param args */ public static void main(String[] args) { new SwingWinAdapterTestTool(); } }
相关文章推荐
- Swing代码分析(事件监听方法四)
- Swing代码分析(事件监听方法三)
- Swing代码分析(事件监听方法一)
- Java添加事件监听的四种方法代码实例
- 使用代码创建的控件对象,设置的事件监听方法不执行的问题
- java基础学习——Java添加事件监听的四种方法代码实例
- Java添加事件监听的四种方法代码实例
- Java添加事件监听的方法及代码实例
- Java添加事件监听的四种方法代码实例
- Java添加事件监听的四种方法代码实例
- **在布局文件中设置Button的点击事件,代码中方法要传入View的原因分析**
- 阅读layim代码小记,监听事件实现方法
- 【Unity&事件】事件监听响应的几种方法分析研究
- bootstrap 事件shown.bs.modal用于监听并执行你自己的代码【写hostmanger关联部门遇到的问题及解决方法】
- 详细代码实现 Button的监听事件的Onclick的三种方法
- Java添加事件监听的四种方法代码实例
- Java添加事件监听的四种方法代码实例
- Java添加事件监听的四种方法代码实例
- JavaScript实现为事件句柄绑定监听函数的方法分析
- NSQ系列之nsqlookupd代码分析三(详解tcpServer 中的IOLoop方法)