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

📄 test.java

📁 该压缩文件中共包含16个非常实用的java学习实例
💻 JAVA
字号:
import java.awt.*;
import java.awt.event.*;


public class Test extends Frame implements WindowListener  
{
	
	TextField t=new TextField();
	Test()
	{
		
		this.addWindowListener(this);
		
		this.add(t,BorderLayout.NORTH);
		this.setSize(400,400);
		this.setVisible(true);
	}
	
	
	public static void main(String args[])
	{
		Test my=new Test();
	
	}

	public void windowOpened(WindowEvent e) {
		// TODO: Add your code here
	}

	public void windowClosing(WindowEvent e) {
		// 在这里关闭窗口
		
		this.dispose();//释放窗口对象
	}

	public void windowClosed(WindowEvent e) {
		System.out.println("窗口已经关闭");
	}

	public void windowIconified(WindowEvent e) {
		// TODO: Add your code here
	}

	public void windowDeiconified(WindowEvent e) {
		// TODO: Add your code here
	}

	public void windowActivated(WindowEvent e) {
		// TODO: Add your code here
	}

	public void windowDeactivated(WindowEvent e) {
		// TODO: Add your code here
	}


}

⌨️ 快捷键说明

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