Added option to execute System.exit(0) on closing of the window.