A gui should not become un-responsive due to a long task running.

If you're using a Swing layered design you can loop through all components which have been added to a particular component.
...