📄 buttonframe.java
字号:
import javax.swing.*;import java.awt.event.*;public class ButtonFrame extends JFrame implements ActionListener { private Timer theTimer; /** post: theTimer == t */ public ButtonFrame(Timer t) { super(""); setBounds(100, 100, 200, 80); setVisible(true); setLayout(null); JButton btn = new JButton("Start Sunrise"); btn.setBounds(10, 10, 180, 30); btn.addActionListener(this); add(btn, 0); repaint(); theTimer = t; } public void actionPerformed( ActionEvent e ) { theTimer.start( ); }}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -