Using a swing worker instead of querying in the event dispatch thread