Hello Roger,
Please use
UBB Code to ident the code.
This is from Thinking in
Java by Bruce Eckel:
Daemon threads
A �daemon� thread is one that is supposed to provide a general service in the background as long as the program is running, but is not part of the essence of the program. Thus, when all of the non-daemon threads complete, the program is terminated. Conversely, if there are any non-daemon threads still running, the program doesn�t terminate. There is, for instance, a thread that runs main( ). Comment
You can find out if a thread is a daemon by calling isDaemon( ), and you can turn the �daemonhood� of a thread on and off with setDaemon( ). If a thread is a daemon, then any threads it creates will automatically be daemons.
Try coomenting out "setDaemon(true);" and you will see the difference.