Problem With JOptionPane.showConfirmDialog
hello there i've made a KeyEvent When The user Presses The alt+f4 key
(f4 While holding down the alt key) a JOptionPane ConfiramtionDialog appears as follows:
if (k.isAltDown() && k.getKeyCode() == KeyEvent.VK_F4)
{
Toolkit tool3 = Toolkit.getDefaultToolkit();
tool3.beep();
int returnValue2=JOptionPane.showConfirmDialog(null,"Do You Really Want To Exit?","EXIT",JOptionPane.YES_NO_OPTION);
if (returnValue2 == JOptionPane.YES_OPTION)
{
System.exit(0);
}
}
and i want to make that if the user presses the no option or the close
option no thing happen or the focus(control )return to the frame
besause i have a nother windowclosing event and when i press the no or close option it goes to execute the windowclosing event and i want to prevent that? this is the windowclosing event
class MyInner3extends WindowAdapter
{
publicvoid windowClosing(WindowEvent ee)
{
Toolkit tool = Toolkit.getDefaultToolkit();
tool.beep();
JOptionPane.showMessageDialog(null,"The Program Will Now Exit",JOptionPane.ERROR_MESSAGE,image );
System.exit(0);
}
}
could any one help me...thank you

