What "more complex situation" is going to stop the progress bar updating? The progress bar setValue() call ensures that any pending repaint is run before returning.

Is the call to setValue() actually being called? Are the values in range?