Improve Swing code, use always the event dispatch thread to show dialogs and define the minimum and prefered size before adding any component