Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to stop this timer?

 
Benjamin Mulder
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This timer triggers a progress bar. The goal is to stop the timer (and therefore the progress bar) when a label changes its text.

However, the timer goes on for ages and the progress bar keeps going until it reaches 100%. The timer never stops, it just that the progress bar can't go any further.

In other words,

1. How do you stop the timer below?

2. How do you make this timer below to listen to other events such as threads terminated or label text change?


Feel free to tweak around the code below so I can see what you mean. I learn by example. ;*)

Thanks in advance,

 
Dirk Schreckmann
Sheriff
Posts: 7023
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With just the above code, I'm not sure if your problem is more GUI- or thread-based.

Let's guess GUI, and I'll move this to the Swing / JFC / AWT forum...
 
Craig Wood
Ranch Hand
Pie
Posts: 1535
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This requires the SwingWorker.java file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic