i need to how to give codings to buttons that are present in confirm dialog box. For Example if there are two buttons as "YES" and "NO" and if i click "YES" then the program should close. If i click no then th dialog box should return to the program. Given below are the codes that i have done up to now and i dont have any idea to proceed further. Please help.
class cancelListener implements ActionListener
{
public void actionPerformed(ActionEvent ev)
{
int n = JOptionPane.showConfirmDialog( frame,
"Are You sure you want to Close?",
"Confirm Log Off",
JOptionPane.YES_NO_OPTION);
}
}