I have a Jframe which contains a table and a button to add a new record, when I click I get a jDialog in which I am doing some validations in case you do not enter anything in the fields, the problem is that when you do not enter nothing I get the message to enter data but instead of staying in the jDialog returns to the Jframe, this is the validation code
if(cboEspecialidad.getSelectedIndex()==0){
JOptionPane.showMessageDialog(null,
"Debe Seleccionar una Especialidad",
"Confirmacion",
JOptionPane.INFORMATION_MESSAGE);
return false;
}