program is working fine on YES option but on NO option it does not return ? any one give me hint ??
this.addWindowListener(new WinAdapter(){
public void windowClosing(WindowEvent e){
String cnic1 = (String)cnic.getValue();
String name1 = name.getText();
String fname1 = fname.getText();
String age1 = (String)age.getValue();
String add1 = add.getText();
String pro1 = pro.getText();
if (cnic1 != null || name1.length() != 0 || fname1.length() != 0 || age1!= null || add1.length() != 0 || pro1.length() != 0){
int n = JOptionPane.showConfirmDialog(RForm.this, "You have not save your Entry, Would you like to Exit!", "Voter Registration Form", JOptionPane.YES_NO_OPTION);
if (n == JOptionPane.YES_OPTION){
System.exit(0);
} else if (n == JOptionPane.NO_OPTION){
[COLOR="Red"][B]return;[/B][/COLOR]
}
}else{
System.exit(0);
}
}
});