This week's giveaway is in the Spring forum.
We're giving away four copies of REST with Spring (video course) and have Eugen Paraschiv on-line!
See this thread for details.
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 REST with Spring (video course) this week in the Spring forum!
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!