I'm working on a task using Java.
It's a simple space-invaders-esque game, I'm trying to implement a Pause prompt which also allows the user to quit the game from the prompt.
However, what's the best way to do this? System.exit(0) is the obvious one i've seen. But this looks messy, it looks like it terminates the entire JVM. The other manner is to have all Swing windows closed, but this in itself looks too convoluted as well.
Is there a simple way to do this?
It's a simple space-invaders-esque game, I'm trying to implement a Pause prompt which also allows the user to quit the game from the prompt.
However, what's the best way to do this? System.exit(0) is the obvious one i've seen. But this looks messy, it looks like it terminates the entire JVM. The other manner is to have all Swing windows closed, but this in itself looks too convoluted as well.
Is there a simple way to do this?