I wanted to try out some ideas using SwingWorker since I haven\'t used it too much. Instead, I ran into an issue and I can\'t figure out what\'s wrong.
I believe that you need to show a visualized Swing top level Window in order to keep the Swing event thread alive. Otherwise the program will shut down for lack of non-daemon threads.
Edit:
To prove that the SwingWorker thread is a Daemon thread, just add a line of code to test it:
System.out.println("I am thread with " + ms + " sleep in iteration "
+ i + ": " + t.getName() + " (" + t.getId() + ")");
// **** added
System.out.println("Daemon?: " + Thread.currentThread().isDaemon());