There is an excellent tutorial at The Java Tutorial called
Using the Timer and TimerTask Classes.
It explains how to use a timer to schedule tasks or to perform tasks repeatedly. With the Timer
and TimerTask
classes you don’t have to create your own threads, it’s all done for you. Thank you Joshua Bloch for writing these classes.
On a side note, Joshua Bloch is one of the premier Java engineers. Recently he left Sun for Google. Gosh, that must have hurt Sun.
You should check out Quartz by OpenSymphony. I think it’s a lot more extensive than the Timer classes.