Next line:
SwingUtilities.updateComponentTreeUI(aComponent);
makes my GUI immune.
Calling this method takes a lot of time to update laf on most of the GUI, so the GUI does not respond during this operation.
Since this operation controls the GUI, you cannot use SwingWorker for this. From the SwingWorker documentation:
Time-consuming tasks should not be run in the event dispatch thread. Otherwise, the application becomes unresponsive.
Swing components should be available in the "Event Manager" section only.
The problem here lies in the fact that the operation to access Swing components and takes a long time.
Is there a good way to prevent this irresponsibility?
source
share