Get flash to fully experience Pearltrees
Tasks can be scheduled for execution in the future. Such tasks can be performed either periodically, or just once. As well, the first execution can be delayed to a specific time in the future.
The java.util.Timer and java.util.TimerTask classes, which I'll refer to collectively as the Java timer framework , make it easy for programmers to schedule simple tasks. (Note that these classes are also available in J2ME.)
In this section, you can learn how to schedule a timer task to run at a certain time and repeatedly.
The TechRepublic CIO50 list celebrates the most influential and innovative tech chiefs, voted by their fellow CIOs
JDK Timer is a simple scheduler for a specified task for repeated fixed-delay execution. To use this, you have to extends the TimerTask abstract class, override the run() method with your scheduler function. RunMeTask.java
import java.util.Timer ; import java.util.TimerTask ; /** * * This class uses the java.util.Timer functionality * The class will repeat itself every second. * * @author Toy */