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)?