Solved

Timers

Posted on 2002-06-03
5
235 Views
Last Modified: 2010-03-31
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
0
Comment
Question by:mouatts
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
Venci75 earned 50 total points
ID: 7050552
Creating a Thread object and using the sleep() method of this thread
0
 
LVL 92

Expert Comment

by:objects
ID: 7050615
Copy the relevent source from 1.3 :)
0
 
LVL 11

Author Comment

by:mouatts
ID: 7050751
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
 
LVL 92

Expert Comment

by:objects
ID: 7052437
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
 
LVL 11

Author Comment

by:mouatts
ID: 7053234
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

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
By the end of 1980s, object oriented programming using languages like C++, Simula69 and ObjectPascal gained momentum. It looked like programmers finally found the perfect language. C++ successfully combined the object oriented principles of Simula w…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question