Solved

Timers

Posted on 2002-06-03
5
234 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
  • 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Weekend adv creator 3 52
egit plugin on eclipse 8 82
Unhandled exception type Exception 18 42
String array comparison 4 38
For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

861 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