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