Hi, this is my application closing code. I have a confirmation dialog box to ask if the user wishes to close the application, what should I put if user decides not to quit the application?
Please enlighten me.Code:public void windowClosing(WindowEvent we) { int answer ; answer = JOptionPane.showConfirmDialog(null,"Are you sure you want to exit?","Exit System",JOptionPane.YES_NO_OPTION) ; if (answer == 0) { System.out.println("You have successfully quit Restaurant System ver. 1.0 Built By: Lex Seetoh") ; System.exit(0) ; } else if (answer == 1) { System.exit(1) ; } }




Reply With Quote