Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Display running time in JLabel

 
Jennifer Sohl
Ranch Hand
Posts: 455
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1141
1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jennifer,
Allow me to suggest the javax.swing.Timer class.

Good Luck,
Avi.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic