
As i said earliar i am making HRMS , the last phase is logout button. when logout button is clicked , an option dialog should appear which ask for yes or no .
PROBLEM is i dont know how to use JOptionPane.YESNOOPTION so that i can give user choice of yes or no before logging out finally..
i also thinking how to use the input (yes or no ) given by the user. Rest i know if i am ab to use the input given by the user.
Please help as soon as possible.
Thanks in advance

Hi,
You will have to use following code:
int i=JOptionPane.showConfirmDialog(null, "Really want to quit?","Really",JOptionPane.YES<em>NO</em>OPTION);
// TODO add your handling code here:
if(i==JOptionPane.YES_OPTION)
{
//CODE WHICH WILL BE CALLED ONCE YES IS PRESSED
}
else
{
//CODE WHICH WILL BE CALLED ONCE NO IS PRESSED
}

You have to store the value of Joption pane in an integer which can be done from following: int i=JOptionPane.showConfirmDialog(null, "Really want to quit?","Really",JOptionPane.YESNOOPTION);
then use if (With int i) to find the answer:
if(i==JOptionPane.YES_OPTION) {
} else {
}