• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 3655
  • Last Modified:

Java StopWatch

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
mack04
Asked:
mack04
1 Solution
 
JakobACommented:
Are you asking about the programming language Jave or about the scripting language JavaScript ? It is 2 very different languages.
0
 
ManishLeadCommented:
I think, you need to learn swing or applet.
0
 
BadotzCommented:
HOMEWORK! AAARRRGGGHHH!
0
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!

 
mack04Author Commented:
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
 
Matty023Commented:
"The start button will cause the display every 1/2 second(500 milliseconds)"

Will cause the display to do what?

0
 
Mayank SAssociate Director - Product EngineeringCommented:
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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

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.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now