📄 windowevent1.java
字号:
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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -