• Post Reply Bookmark Topic Watch Topic
  • New Topic

Updating JLabel

 
Shannon Sims
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Is there a way to update a JLabel continually until the predefined minutes runs down to zero? The JLable would look like this:

Time Left: 1 min. 49 sec.
Time Left: 1 min. 48 sec.
Time Left: 1 min. 47 sec.
ect.

Can the SwingPropertyChangeListener help? If so, can you point me to an article which explains this thoroughly or is there a small running sample of this? Unfortunately, there isn't much information in my Swing book or on the internet.

Thank you.
 
Michael Dunn
Ranch Hand
Posts: 4632
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
use a timer

something like this

 
Shannon Sims
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's wonderful! Thank you Michael. Wow, didn't realize it would be that easy, thought I would have to do something crazy!

Thanks again!!!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!