⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sdatimer.java

📁 很好的UI界面源码..还有自己的输入法,可以更换风格.可以学习和使用
💻 JAVA
字号:
/* * To change this template, choose Tools | Templates * and open the template in the editor. */package cn.sda.ui;import cn.sda.event.TimerTickEvent;import java.util.Timer;import java.util.TimerTask;/** * * @author Administrator */public class SDATimer {    private int interval = 1000;    private boolean enabled = false;    private TimerTickEvent onTick = null;    private Timer timer = null;    private TimerTask timertask = null;    public SDATimer() {    }    public boolean isEnabled() {        return enabled;    }    public void setEnabled(boolean enabled) {        if (onTick != null) {            this.enabled = enabled;            if (enabled) {                timer = new Timer();                timertask = new TimerTask() {                    public void run() {                        //时钟执行                        doOnTick();                    }                };                timer.schedule(timertask, interval, interval);            } else {                timertask.cancel();                timer.cancel();                timertask = null;                timer = null;            }        }    }    public int getInterval() {        return interval;    }    public void setInterval(int interval) {        this.interval = interval;    }    public void setOnTick(TimerTickEvent onTick) {        this.onTick = onTick;    }    private void doOnTick() {        if (onTick != null) {            onTick.Event();        }    }}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -