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

📄 nestlistener.java

📁 东软JAVA内部资料
💻 JAVA
字号:
package org.course.gui;
import java.awt.*;
import java.awt.event.*;
public class NestListener extends Frame{
	Button bClose;
	
	public NestListener() {
		super("Listener Nested");
		bClose = new Button("close");
		this.add(bClose, BorderLayout.SOUTH);
		
		this.addWindowListener(new WindowLis());
		bClose.addActionListener(new ActionLis());
		
		this.setSize(400,300);
		this.setVisible(true);
	}
	
	public void close() {
		this.dispose();
	}
	
	public class ActionLis implements ActionListener {

		public void actionPerformed(ActionEvent e) {
			// TODO Auto-generated method stub
			close();
		}		
	}
	
	public class WindowLis extends WindowAdapter {
		public void windowClosing(WindowEvent e) {
			// TODO Auto-generated method stub
			close();
		}		
	}
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		new NestListener();
	}

}

⌨️ 快捷键说明

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