Make better use of the AWT dispatch thread.