Re: My JProgressBar does not show till the end of its loop condition.
Thursday, March 22, 2001 03:17 AM
It's hard to say what you do wrong but a will give you general hints for the JProgressBar approach. First, make sure that your thread that update the progressbar runs in the event dispatch thread (AWT thread). You must also make sure that you call the (event dispatch) javax.swing.SwingUtilities.invokeAndWait(myUpdateThread) every time you want to update the progressbar. Thus you may preferably use two threads(main thread is not included) for this approach. One thread that do the real work, recordset processing. Another thread that do the progressbar update. The latter thread must execute on the event dispatch thread.