This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes how to stop this timer? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to stop this timer?" Watch "how to stop this timer?" New topic
Author

how to stop this timer?

Benjamin Mulder
Greenhorn

Joined: Mar 13, 2004
Posts: 18
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

Joined: Dec 10, 2001
Posts: 7023
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...


[How To Ask Good Questions] [JavaRanch FAQ Wiki] [JavaRanch Radio]
Craig Wood
Ranch Hand

Joined: Jan 14, 2004
Posts: 1535
This requires the SwingWorker.java file.
 
wood burning stoves
 
subject: how to stop this timer?
 
Similar Threads
spalsh screen
Progress Percentage Problem
JProgressbar problem
Threads... changing while loop....
JProgressBar not appearing properly