Created
December 25, 2011 03:57
-
-
Save anonymous/1518702 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package peanut.org; | |
import java.util.*; | |
public class TimeObserver { | |
DailyWork dailyWork; | |
Timer AskWorkWindowTimer; | |
public TimeObserver(DailyWork dailyWork) { | |
this.dailyWork = dailyWork; | |
} | |
public void countDown(){ | |
/*每隔一段時間,執行某工作。(Timer、TimerTask的使用)*/ | |
System.out.println("開始倒數..."); | |
AskWorkWindowTimer = new Timer(); | |
AskWorkWindowTimer.schedule(new AskWorkWindow(AskWorkWindowTimer, this.dailyWork, this) , dailyWork.getPeriod()*1000); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment