3月24日,TestFrame采用适配器形式产生匿名对象,每日20行。
2017-03-24 19:05
381 查看
import java.awt.*; import java.awt.event.*; public class TestFrame { public static void main(String[] args) { Frame f = new Frame("A Test Window"); f.setSize(320, 180); f.setVisible(true); f.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { System.out.println("我退出了!"); e.getWindow().setVisible(false); ((Window)e.getComponent()).dispose(); System.exit(0); } }); } }
相关文章推荐
- 3月22日,TestFrame采用接口形式产生匿名对象,每日20行。
- 3月23日,TestFrame采用事件适配器方式,每日20行。
- 3月21日,TestFrame对象是事件源又是监听者,每日20行。
- C++ 匿名对象产生场景
- 3月5日,TestFrame,每日20行。
- 实现 一个类,使得该类任何形式的 派生类 无论怎么定义和实现,都无法产生任何对象 实例 (原创)
- 3月20日,TestFrame_Listener,每日20行。
- 3月24日,着手开发 CriminalIntent,Android 开发,每日20行,第15天。
- Java学习之形式参数与匿名对象
- 强化训练3--构造函数中调用构造(产生匿名对象)
- 把匿名对象转换成成员名索引形式的动态对象
- ICE学习笔记3:对象适配器
- SNAP的另类实现,采用js生成IFRAME内嵌框架的形式实现链接的网页'图像预览'
- 对象池(对象缓冲池)--采用最近最久未使用策略管理对象,同时带有事件监听功能
- MFC临时对象的所产生的BUG
- 对象适配器和类适配器
- [java] "Hello"和new String("Hello")产生String对象的区别
- c++ 匿名对象现象
- 当某个表中存在标志表格中记录不同状态的判断性字段的时候,采用两种不同的数据库组织形式,查询执行速度的实验。
- 利用key,value形式储存对象的类(Map,HashMap)