I am trying to create a program to perform a simple task and produce an output every x
seconds. I also want the program to run until I decide to manually close
Use java.util.Timer instead. The associated thread will not run as a daemon.
A Swing Timer will stay alive as long as the EDT is alive, usually this is done by having a Swing GUI present and visible (this creates a non-daemon thread that persists until the GUI exits). If you don't need a Swing GUI, then don't use a Swing Timer. Perhaps instead use a java.util.Timer, and don't exit the main method til you give the word (however you plan to do that).