Ahora muestra el JOptionPane sobre la ventana principal, no en medio de la pantalla
This commit is contained in:
@@ -233,7 +233,7 @@ public class MainView extends JFrame {
|
|||||||
|
|
||||||
private void borrarRegistro() {
|
private void borrarRegistro() {
|
||||||
|
|
||||||
if (JOptionPane.showConfirmDialog(null, "¿Desea borrar el registro?", "¿Está seguro?", JOptionPane.YES_NO_OPTION) == 0) {
|
if (JOptionPane.showConfirmDialog(this, "¿Desea borrar el registro?", "¿Está seguro?", JOptionPane.YES_NO_OPTION) == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -246,9 +246,9 @@ public class MainView extends JFrame {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (resultado > 0) {
|
if (resultado > 0) {
|
||||||
JOptionPane.showMessageDialog(null, "Registro borrado correctamente");
|
JOptionPane.showMessageDialog(this, "Registro borrado correctamente");
|
||||||
} else {
|
} else {
|
||||||
JOptionPane.showMessageDialog(null, "No se pudo borrar el registro");
|
JOptionPane.showMessageDialog(this, "No se pudo borrar el registro");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -256,11 +256,11 @@ public class MainView extends JFrame {
|
|||||||
private void guardarRegistro() {
|
private void guardarRegistro() {
|
||||||
if (tabbedPane.getSelectedComponent() == panelCursos) {
|
if (tabbedPane.getSelectedComponent() == panelCursos) {
|
||||||
if (ControladorCurso.guardarCurso(panelCursos.getCursoActual()) > 0) {
|
if (ControladorCurso.guardarCurso(panelCursos.getCursoActual()) > 0) {
|
||||||
JOptionPane.showMessageDialog(null, "Registro guardado correctamente");
|
JOptionPane.showMessageDialog(this, "Registro guardado correctamente");
|
||||||
}
|
}
|
||||||
} else if (tabbedPane.getSelectedComponent() == panelMaterias) {
|
} else if (tabbedPane.getSelectedComponent() == panelMaterias) {
|
||||||
if (ControladorMateria.guardarMateria(panelMaterias.getMateriaActual()) > 0) {
|
if (ControladorMateria.guardarMateria(panelMaterias.getMateriaActual()) > 0) {
|
||||||
JOptionPane.showMessageDialog(null, "Registro guardado correctamente");
|
JOptionPane.showMessageDialog(this, "Registro guardado correctamente");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user