📄 ewindow.java
字号:
/* * EWindow.java * * Created on 2004年9月19日, 上午9:49 *//** * * @author litertiger */import java.awt.*;import java.applet.*;import java.awt.event.*;/** * */ class EWindow2 extends Frame implements ActionListener { TextArea text; Button button; /** Creates a new instance of EWindow */ public EWindow2() { super("我能工作了 "); text=new TextArea(10,10);text.setBackground(Color.BLUE); button=new Button("确定"); button.addActionListener(this);//这句是一定要输入的 //否则button的事件是不要求处理的 setLayout(new BorderLayout()); setSize(80,80); setVisible(true); add(text,"Center"); add("South",button); addWindowListener(new Goodboy()); } public void actionPerformed(ActionEvent e) { if(e.getSource()==button) { text.setText("我爱我家"); } } class Goodboy extends WindowAdapter { public void windowClosing(WindowEvent e) { System.exit(0); } } } public class EWindow{ public static void main(String args[]) {EWindow2 w=new EWindow2(); } }
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -