wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes Display running time in JLabel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Display running time in JLabel" Watch "Display running time in JLabel" New topic
Author

Display running time in JLabel

Jennifer Sohl
Ranch Hand

Joined: Feb 28, 2001
Posts: 455
I need to display the running time (Only need HH:MM) in a JLabel for one of our apps. The time I need to display is the time from our database. I am getting the time from our DB with a stored procedure. I could just go out to the DB every minute and get the time, but that seems very inefficient, doesn't it?

Is there any other way to accomplish this?



Thanks for any help!
Avi Abrami
Ranch Hand

Joined: Oct 11, 2000
Posts: 1121

Jennifer,
Allow me to suggest the javax.swing.Timer class.

Good Luck,
Avi.
 
Consider Paul's rocket mass heater.
 
subject: Display running time in JLabel
 
Similar Threads
How to read instance variable dynamically?
On the fly html
refresh a JPanel automatically as time changes
howto prevent JLabel text selection
web application works fine with us and canada time