展开全部
/**
* 小小的计时器
*/
public class TimerFrame extends JFrame {
private static final String INITIAL_LABEL_TEXT = "00:00:00 000";
// 计数线程62616964757a686964616fe4b893e5b19e31333337626165
private CountingThread thread = new CountingThread();
// 记录程序开始时间
private long programStart = System.currentTimeMillis();
// 程序一开始就是暂停的
private long pauseStart = programStart;
// 程序暂停的总时间
private long pauseCount = 0;
private JLabel label = new JLabel(INITIAL_LABEL_TEXT);
private JButton startPauseButton = new JButton("开始");
private JButton resetButton = new JButton("清零");
private ActionListener startPauseButtonListener = new ActionListener() {
public void actionPerformed(ActionEvent e) {
if (thread.stopped) {