windoweventtest3.java

来自「JAVA SE6 全方位学习 朱仲杰 编著 机械工业出版社出版」· Java 代码 · 共 32 行

JAVA
32
字号
import java.awt.*;import java.awt.event.*;public class WindowEventTest3{	public static void main(String argv[])	{		Frame f = new Frame("WindowEventTest3");		f.addWindowListener(new WindowEventHandler1());                f.addWindowListener(new WindowEventHandler2());		f.setSize(200,200);		f.setVisible(true);	}}class WindowEventHandler1 extends WindowAdapter{	public void windowClosing(WindowEvent e)	{		System.out.println("Handler 1");	}}class WindowEventHandler2 extends WindowAdapter{        public void windowClosing(WindowEvent e)        {                System.out.println("Handler 2");                  System.exit(0);        }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?