Two Laptop Bag
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
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Display running time in JLabel" Watch "Display running time in JLabel" New topic

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: 1141

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

Good Luck,
I agree. Here's the link:
subject: Display running time in JLabel
It's not a secret anymore!