Dialog with swingworker is a chicken/egg
问题 I am trying to follow the Java best practices by not doing long tasks on the main thread (EDT). So I am planning to use a swingWorker with Modal Dialog. This way the modal dialog blocks the user for doing anything until that task is done and I can update status on the dialog while the process is taking place. Now the problem is that with the modal dialog, it not only blocks the user but also nothing after setVisible gets called So if I do dialog.setVisible(true); new SwingWorkerTask().execute