📄 demobutton.java
字号:
//Figure 8.28import java.awt.event.*;public class DemoButton extends EventButton { private int clickCount; /** post: getX() == x and getY() == y * and getWidth() == 150 and getHeight() == 30 * and getText() is "DEMO" and clickCount == 0 */ public DemoButton( int x, int y ) { super( "DEMO" ); setBounds(x, y, 150, 30); clickCount = 0; } /** post: a message has been sent to standard output */ public void actionPerformed( ActionEvent e ) { clickCount++; System.out.println("Demo click count is " + clickCount ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -