My Java Swing app performs a number of HTTP requests that, by nature, freeze the screen until response received and processed.
I would like to show a wait cursor during this time, using:
frame.setCursor(JFrame.WAIT_CURSOR);
Unfortunately, this is not working as it is being executed on the UI Thread which will continue processing my HTTP requests.
I'm aware that I should execute the lengthy tasks on a separate Swing Worker Thread, but, to keep my code simple (because in some cases my HTTP request can be interrupted to show a dialog that needs to be executed on the UI thread), I'm looking for a solution to "force" swing to update the mouse cursor before executing future code.
Is there any way to achieve this?