Timers

According to Suns documentation java.util.timer was added in 1.3, but it doesn't say when javax.swing.timer was added although as swing was added in 1.3 I'm assuming that it was also added then.

With all that in mind how do you implement a timer in 1.2

Steve
LVL 11
mouattsAsked:
Who is Participating?
 
Venci75Connect With a Mentor Commented:
Creating a Thread object and using the sleep() method of this thread
0
 
objectsCommented:
Copy the relevent source from 1.3 :)
0
 
mouattsAuthor Commented:
Objects: I'll leave bloatware to Microsoft :)

Venci75: Thanks. I suspected this might be the case just it seemed such a strange omission from 1.2 that we were forced to use a method from the dark ages, that I figured maybe I had missed something.

Steve
0
 
objectsCommented:
Could also argue that your reinventing the wheel :)
Depends on what functionality you require from your timers, if you need the same as what Sun provides then I don't see much difference between reimplementing it yourself and using already implemented and tested code.
:-)
0
 
mouattsAuthor Commented:
Objects: The main difference if re-using the sun code is that the code will need to be downloaded as part of the jar whereas if its part of the JVM it doesn't, therefore download times will be worse.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.