Cool, worked first time - again thanks!

I swear this is the last request on this thread lol. How do I invoke a 'System.exit(0)' when closing my main JFrame as the engine is still running in the background, i.e. I would like to change my 'setDefaultCloseOperation(DO_NOTHING_ON_CLOSE);'