timepanel.java
来自「自己编写的扫雷游戏的源代码」· Java 代码 · 共 70 行
JAVA
70 行
package screen;import java.awt.*;import java.util.*;/** * Title: * Description: * Copyright: Copyright (c) 2004 * Company: * @author * @version 1.0 */public class TimePanel extends ShowNumberPanel { BorderLayout borderLayout1 = new BorderLayout(); TimerThread timeThread = null; int second = 0; public TimePanel() { try { jbInit(); } catch(Exception ex) { ex.printStackTrace(); } } public void start() { if (timeThread == null) { timeThread = new TimerThread(this); timeThread.start() ; } else { second = 0; timeThread.resume(); } } public void stop() { if(timeThread!=null) { timeThread.stopThread(); timeThread.suspend(); } second = 0; } public void showSecond() { showNumber(second); second ++; } public void ready() { stop(); showNumber(second); } void jbInit() throws Exception { super.jbInit(); }}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?