📄 actionevent1.java
字号:
import java.awt.*;
import java.awt.event.*;
public class ActionEvent1 extends Frame{
Button button;
public ActionEvent1(String title){
super(title);
ActionListener ac=new ActionHandler();
button=new Button("犬牢");
button.addActionListener(ac);
add(button);
}
public static void main(String[] args){
ActionEvent1 me=new ActionEvent1("咀记 捞亥飘 贸府");
me.pack();
me.setVisible(true);
}
class ActionHandler implements ActionListener{
public void actionPerformed(ActionEvent e){
System.out.println(e.getActionCommand());
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -