-
JProgressBar
I have a JFrame with a button which connects to a SQL server. In the try-catch code, i have progressBar.setValue(*value*); methods. When the code is executed and it is connecting to the server, the progress bar doesn't update on the form.
I read that this is due to the fact that the UI doesn't update the form until after the thread is done processing.
Is there any type of Java equilvalent code to the VB.net code Application.DoEvents() (or VB6 DoEvents function)?
-
Re: JProgressBar
No DoEvents. In Java you're expected to use threads for long operations.
However, there is a method to force a redraw of the windows immediately. I forgot its name.
-
Re: JProgressBar
its not JProgressBar1.UpdateUI(); is it? I tried that and it didnt work...
-
Re: JProgressBar
No, I'm talking about repaint().
Mostly, though, if you really have a long task, you should just spawn a thread for it.