sim
the window remains open.
private void formWindowClosing(java.awt.event.WindowEvent evt) {
// TODO add your handling code here:
int Confirm = JOptionPane.showConfirmDialog(null,"Encerrar?","sim ou nao", JOptionPane.YES_NO_OPTION);
if (Confirm == JOptionPane.YES_OPTION) {
JOptionPane.showMessageDialog(null, "");
System.exit(0);
} else if (Confirm == JOptionPane.NO_OPTION){
setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
}
}
It does not give any error, the problem is that choosing não
the window closes. Until then correct, but choosing sim
it closes the same way.