?? actioncommandbutton.java
字號:
import java.awt.*;
import java.awt.event.*;
public class ActionCommandButton
implements ActionListener {
private Frame f;
private Button b;
public void go() {
f = new Frame("Sample Button");
b = new Button("Sample");
b.setActionCommand("Action Command Was Here!");
b.addActionListener(this);
f.add(b);
f.pack();
f.setVisible(true);
}
public void actionPerformed( ActionEvent ae) {
System.out.println("Button press received.");
System.out.println("Button's action command is: "+
ae.getActionCommand());
}
public static void main (String args[]) {
ActionCommandButton actionButton =
new ActionCommandButton();
actionButton.go();
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -