...
>I keep getting a flicker occasionally when I update a screen.
...

Signature
Andrew Thompson
http://www.athompson.info/andrew/
> This *might* be the Swing/EDT problem.
> Look into SwingWorker.invokeLater(Thread) method, &
> <http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html>
Indeed that was the problem. I am somewhat new to JAVA, not
programming. I was forced to learn 'by fire' Java when another person
left the company, and I inherited a program, it did not use the
swing.invokelater for the progress bars, and they get updated twice a
second, which occaisonally caused stack trace errors, but the program
ran fine. I added the Swing.invokelater thread and the errors went
away.
Thanks for your assistance!
Ryan
Lew - 14 Sep 2007 03:09 GMT
>> This *might* be the Swing/EDT problem.
>> Look into SwingWorker.invokeLater(Thread) method, &
>> <http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html>
>
> Indeed that was the problem. I am somewhat new to JAVA [sic],
It's spelled "Java".
> not programming. I was forced to learn 'by fire' Java when another person
> left the company, and I inherited a program, it did not use the
> swing.invokelater for the progress bars, and they get updated twice a
> second, which occaisonally caused stack trace errors, but the program
> ran fine. I added the Swing.invokelater thread and the errors went
> away.
The issue is thread concurrency. The EDT (Event Dispatch Thread) is supposed
to handle all graphic actions, and only graphic actions. Any other lengthy
work should run in a different thread.
SwingWorker.invokeLater() is a cover method for EventQueue.invokeLater() which
is a convenience method to invoke graphic actions on the EDT instead of on the
wrong thread.
Multi-threading means concurrency headaches. Study it in the Java tutorial
and in /Java Concurrency in Practice/, by Brian Goetz, et al.

Signature
Lew
Roedy Green - 14 Sep 2007 03:47 GMT
>SwingWorker.invokeLater()
see http://mindprod.com/jgloss/swingthreads.html

Signature
Roedy Green Canadian Mind Products
The Java Glossary
http://mindprod.com
Andrew Thompson - 14 Sep 2007 08:17 GMT
>> This *might* be the Swing/EDT problem.
>> Look into SwingWorker.invokeLater(Thread) method, &
>> <http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html>
>
>Indeed that was the problem.
You can chalk that answer up to Tom Hawtin, who
spent a considerable amount of time convincing me
that the use of invokeLater() was actually necessary.
( Oh, and Lew posted that link the other day - lucky
I was paying attention.. )
>Thanks for your assistance!
I'll pass that on to Tom. ;-)

Signature
Andrew Thompson
http://www.athompson.info/andrew/
Nigel Wade - 14 Sep 2007 15:21 GMT
>> This *might* be the Swing/EDT problem.
>> Look into SwingWorker.invokeLater(Thread) method, &
[quoted text clipped - 9 lines]
>
> Thanks for your assistance!
If this application is a vital one, and you need to get it right, then it's
definitely worth you taking the time to read the Java/Swing Tutorial. There is
a section dedicated to progress bars, and also another on threads in Swing.
http://java.sun.com/docs/books/tutorial/uiswing/components/progress.html
http://java.sun.com/docs/books/tutorial/uiswing/concurrency/index.html
You might want to re-visit the code afterwards and verify that its use of
threads is valid given that you've already found one misuse.

Signature
Nigel Wade, System Administrator, Space Plasma Physics Group,
University of Leicester, Leicester, LE1 7RH, UK
E-mail : nmw@ion.le.ac.uk
Phone : +44 (0)116 2523548, Fax : +44 (0)116 2523555