File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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 Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "how to stop this timer?" Watch "how to stop this timer?" New topic

how to stop this timer?

Benjamin Mulder

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

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 file.
I agree. Here's the link:
subject: how to stop this timer?
It's not a secret anymore!