?
Solved

Java StopWatch

Posted on 2007-04-05
8
Medium Priority
?
3,632 Views
Last Modified: 2013-11-23
I need to write an interactive application(java) to simulate a stop watch. The start button will cause the display every 1/2 second(500 milliseconds) A stop button and the elapsed time will be displayed. A third clear button will reset all to zero. 3 buttons and two labels. I need code ASAP! Stopwatch code and Stopwatchtester.
0
Comment
Question by:mack04
[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
8 Comments
 
LVL 15

Expert Comment

by:JakobA
ID: 18862478
Are you asking about the programming language Jave or about the scripting language JavaScript ? It is 2 very different languages.
0
 
LVL 11

Expert Comment

by:Manish
ID: 18862612
I think, you need to learn swing or applet.
0
 
LVL 29

Expert Comment

by:Badotz
ID: 18862906
HOMEWORK! AAARRRGGGHHH!
0
Turn your laptop into a mobile console!

The CV211 Laptop USB Console Adapter provides a direct Laptop-to-Computer connection for fast and easy remote desktop access with no software to install.

 

Author Comment

by:mack04
ID: 18862995
I need to write an interactive application(java) to simulate a stop watch. The start button will cause the display every 1/2 second(500 milliseconds) A stop button and the elapsed time will be displayed. A third clear button will reset all to zero. 3 buttons and two labels. I need code ASAP! Stopwatch code and Stopwatchtester. (java programming language-not javascript) I'm on travel for my job and will not have time to work on it.
0
 
LVL 1

Expert Comment

by:Matty023
ID: 18863563
"The start button will cause the display every 1/2 second(500 milliseconds)"

Will cause the display to do what?

0
 
LVL 30

Accepted Solution

by:
Mayank S earned 2000 total points
ID: 18864102
Sorry we can't provide you full code. It is against site rules.

Have a look at Swing for developing the UI -http://www.exampledepot.com/egs/javax.swing/pkg.html

You can create a JFrame and add buttons/ labels to it using the examples on that page. You can write action event listeners for the buttons:

http://www.exampledepot.com/egs/java.awt.event/ActionEvents.html

Then you need to create, stop and reset timers based on the button which was clilcked, in their respective event handlers:

http://www.exampledepot.com/egs/java.util/pkg.html#Timers
0

Featured Post

Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

Question has a verified solution.

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

JavaScript can be used in a browser to change parts of a webpage dynamically. It begins with the following pattern: If condition W is true, do thing X to target Y after event Z. Below are some tips and tricks to help you get started with JavaScript …
This article discusses how to create an extensible mechanism for linked drop downs.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Suggested Courses
Course of the Month12 days, 11 hours left to enroll

777 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