Modified code to comply with the Swing threading policy.  All calls to
GUI objects are made from the event-dispatch thread.