1.in my project...if user want to exit from the application... it first check yes no cancel option,if the user want to choose ,no or cancel button .. the application is not closed..but my problem is what code placed for no or cancel button...to prevent closing window...
code is...
class wl extends WindowAdapter{
public void windowClosing(WindowEvent e){
System.out.println("closing window"+e);
int result=JOptionPane.showConfirmDialog(null, "Are you sure to exit?","Confirm Exit", JOptionPane.YES_NO_CANCEL_OPTION, JOptionPane.WARNING_MESSAGE );
if (result==JOptionPane.YES_OPTION){
System.exit(0);
}
if (result==JOptionPane.NO_OPTION){
//??????
}
if (result==JOptionPane.CANCEL_OPTION){
//??????
}
}
2.what is the use of dispose method in JFrame...