windowevent1.java

来自「该原代码为<Java编程基础、应用与实例>的附盘代码」· Java 代码 · 共 31 行

JAVA
31
字号
import java.awt.*;
import java.awt.event.*;
public class WindowEvent1 extends Frame implements WindowListener{
  public WindowEvent1(){
  	setTitle("扩档快 捞亥飘 贸府");
    addWindowListener(this);
  }
  public void windowClosing(WindowEvent e){
    Dialog d=new Dialog(this,"辆丰 犬牢",true);
    Panel p=new Panel();
    p.setLayout(new GridLayout());
    p.add(new Button("抗"));
    p.add(new Button("酒聪坷"));
    d.add(new Label("琳丰窍矫摆嚼聪鳖?",Label.CENTER),"Center");
    d.add(p,"South");
    d.setSize(200,100);
    d.setVisible(true);
  }
  public void windowClosed(WindowEvent e){}
  public void windowDeactivated(WindowEvent e){}
  public void windowActivated(WindowEvent e){}
  public void windowIconified(WindowEvent e){}
  public void windowDeiconified(WindowEvent e){}
  public void windowOpened(WindowEvent e){}
		
  public static void main(String[] args){
    WindowEvent1 me=new WindowEvent1();
    me.setSize(200,200);
    me.setVisible(true);
  }
}

⌨️ 快捷键说明

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