⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windoweventtest.java

📁 JAVA SE6 全方位学习 朱仲杰 编著 机械工业出版社出版
💻 JAVA
字号:
import java.awt.*;import java.awt.event.*;public class WindowEventTest extends MouseAdapter{	public static void main(String argv[])	{		Frame f = new Frame("WindowEventTest");		f.addWindowListener(new WindowEventHandler());		f.setSize(200,200);		f.setVisible(true);	}	}class WindowEventHandler implements WindowListener{	public void windowClosing(WindowEvent e)	{		System.out.println("Window Closing event");		System.exit(0);	}	public void windowIconified(WindowEvent e)	{		System.out.println("Window Iconified event");	}        public void windowActivated(WindowEvent e)        {                System.out.println("Window Activated event");        }        public void windowOpened(WindowEvent e) { }        public void windowDeiconified(WindowEvent e) { }        public void windowClosed(WindowEvent e) { }        public void windowDeactivated(WindowEvent e) { }}

⌨️ 快捷键说明

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