Solved

Java StopWatch

Posted on 2007-04-05
8
3,617 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
Why You Need a DevOps Toolchain

IT needs to deliver services with more agility and velocity. IT must roll out application features and innovations faster to keep up with customer demands, which is where a DevOps toolchain steps in. View the infographic to see why you need a DevOps toolchain.

 

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 500 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

U.S. Department of Agriculture and Acronis Access

With the new era of mobile computing, smartphones and tablets, wireless communications and cloud services, the USDA sought to take advantage of a mobilized workforce and the blurring lines between personal and corporate computing resources.

Question has a verified solution.

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

Today, the web development industry is booming, and many people consider it to be their vocation. The question you may be asking yourself is – how do I become a web developer?
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.

724 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