posted 21 years ago
The idea of running in the background is an pperating system concept, not an application one. For example, from a Unix shell, you could type something like:
java MyProgram &
to run the program in the background. That means the program runs, but leaves you free to type other stuff at the command prompt. You can also use:
nohup java MyProgram &
to ensure that your program doesn't exit, even if you close your shell. All output then goes to a file called nohup.out.
As for your application, Thread.sleep(miliseconds) is the easiest way to pause for a set amount of time. If you want to wake up at a certain time, there are some timer classes that can probably help you.