zoukankan      html  css  js  c++  java
  • Java GUI 窗体事件

    import java.awt.Frame;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    
    public class Java窗体事件 {
    	public static void main(String[] args) {
    		Frame f = new Frame("WindowEvent");
    		f.setSize(400,300);
    		f.setLocation(300, 200);
    		f.setVisible(true);
    		f.addWindowListener(new WindowAdapter() {
    			public void windowOpened(WindowEvent e) {
    				System.out.println("windowOpened---窗体打开事件");
    			}
    
    			@Override
    			public void windowActivated(WindowEvent e) {
    				// TODO Auto-generated method stub
    				System.out.println("windowActivated---窗体激活事件");
    			}
    
    			@Override
    			public void windowClosed(WindowEvent e) {
    				// TODO Auto-generated method stub
    				System.out.println("windowClosed---窗体关闭事件");
    				
    			}
    
    			@Override
    			public void windowClosing(WindowEvent e) {
    				// TODO Auto-generated method stub
    				System.out.println("windowClosing---窗体正在关闭事件");
    				
    			}
    
    			@Override
    			public void windowDeactivated(WindowEvent e) {
    				// TODO Auto-generated method stub
    				System.out.println("windowDeactivated---窗体停用事件");
    				
    			}
    
    			@Override
    			public void windowDeiconified(WindowEvent e) {
    				// TODO Auto-generated method stub
    				System.out.println("windowDeiconified---窗体取消图标化事件");
    				
    			}
    
    			@Override
    			public void windowIconified(WindowEvent e) {
    				// TODO Auto-generated method stub
    				System.out.println("windowiconified---窗体图标化事件");
    				
    			}
    		});
    	}
    
    }
    
    
  • 相关阅读:
    c# 发送邮件笔记(一)
    windows API(一)
    SubSonic3.0安装
    Node.js安装MongoDB驱动
    JDBC连接数据库方法
    Delphi LiveBindings如何绑定一个对象(二)(转)
    delphi RTTI机制学习(一)
    Delphi LiveBinds组件
    mysql 每个分类各取5条
    mysql in(...) 1次取出当前记录及上1条下1条记录, 且使用了主键作为索引
  • 原文地址:https://www.cnblogs.com/a1439775520/p/13076537.html
Copyright © 2011-2022 走看看