Java gui not updating

Rated 3.96/5 based on 959 customer reviews

My question is, how do I call a method (that updates the GUI) within the GUI class from another thread?

Keeping in mind that code is executed perfectly, the GUI elements are just not updated. Whenever incoming File Request is called from within the GUI class (from any Event Listener) it works perfectly and the GUI is updated.

The vicious cycle is broken through EDT entering a new message loop, which dispatches the messages as per normal until "modal dialog is over" arrives and normal message processing resumes from the blocked position in the component action.

The open source Foxtrot project emulates the Swing message loop pumping to provide the "synchronous" execution mechanism for arbitrary user tasks, which proceeds only after the worker completes the task.

java gui not updating-78

java gui not updating-61

EDT consumes them one after another and responds by updating the GUI components.I have tried pausing without using threads (with a do-while loop which waits for a certain amount of time to elapse) but this does not work either. page=1 I am still fairly new when it comes to threads.I have tried pausing without using threads (with a do-while loop which waits for a certain amount of time to elapse) but this does not work either.You see, this takes time (user responds in matter of seconds) and you need a responsive GUI (the messages are still pumped in EDT) during all this time while EDT is blocking (it does not handle newer, e.g.JFile Chooser, messages in the queue before the dialog is closed and current component action is finished).

Leave a Reply