protected void thisWindowClosing(WindowEvent e)
{
int n = JOptionPane.showConfirmDialog(e.getWindow() , "¿DESEA CERRAR EL PROGRAMA?",
"Confirmación", JOptionPane.YES_NO_OPTION);
if(n==JOptionPane.YES_OPTION)
{
JOptionPane.showMessageDialog(null, "GRACIAS POR UTILIZAR EL PROGRAMA");
System.exit(0);
}
}
When I select SI
, the window closes but when I select NO the same sale closes, I would like to know how to do so that when I select NO, the window will not close.