I need to use a JProgressBar to display progress while saving a 
large document.  I'm running into the common problem that you need 
to actually do the work outside the event thread so the progress 
bar will update during the work.  I have read about using 
SwingWorker, but this really doesn't seem to solve my problem.

I need to do a Save in response to a menu command.  I need to 
ensure that the save happens synchronously before other operations 
could happen.  If I use a separate thread to do the actual save, 
the event thread will still run and I may get other user events 
before the save is completed.  The problem is that these other user 
events may change the document while it is being saved.

I could disable all commands until the save is done but this seems 
like a heavy handed solution to solve a deficiency in 
JProgressBar.  I also tried using paintImmediately() after setting 
the progress bar's value.  This works, but the bar flickers like 
double buffering isn't happening with paintImmediately.

This must be a common problem.  What is the accepted solution?

Thanks.
--
Bill Tschumy
Otherwise -- Austin, TX
[EMAIL PROTECTED]

_______________________________________________
Advanced-swing mailing list
[EMAIL PROTECTED]
http://eos.dk/mailman/listinfo/advanced-swing

Reply via email to