I’m running a program in Java which performs a long process. Obviously this causes the event dispatcher thread to get really busy and so stop responding/updating the UI.
I would like it to update the UI while I’m doing this process (I give some information back to the user while it runs). I realise the proper way of doing this would be to use a swing worker thread, or other multi-threaded solution – but for this case assume I can’t complicate it too much.
Now in C# there’s a dirty fix called “Application.DoEvents()” which forces the UI to update itself – which gives the result I’m looking for. Is there anything similar in Java? I would just like something quick I can plug into the loop without having to break out the multi-threading.
Thanks.
Swing worker designed exactly for this kind of tasks. It is the way you should write applications in swing. What do mean by “I can’t complicate it too much”?