窗口监听
package com.hua.demo3; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; public class TestWindow { public static void main(String[] args) { new WindowFrame(); } } class WindowFrame extends Frame{ public WindowFrame() { setBounds(100,100,200,200); setVisible(true); this.addWindowListener(new WindowAdapter() { //匿名内部类 //关闭窗口 @Override public void windowClosing(WindowEvent e) { System.out.println("windowClosing"); System.exit(0); } //激活窗口 @Override public void windowActivated(WindowEvent e) { WindowFrame frame = (WindowFrame) e.getSource(); frame.setTitle("被激活了"); System.out.println("windowActivated"); } }); } }
我的一生
第1章-废物的一生
第50章-糟糕的婴儿
第300章-莫欺少年穷
第600章-莫欺中年穷
第1000章-莫欺老年穷
第1100章-不详的离去
第1101章-棺材板的震动
第1150章-盗墓贼的眼泪
第1200章-死者为大