From 70f60810d027800b5225d87120adba1c1adebb78 Mon Sep 17 00:00:00 2001 From: Roberto Date: Sun, 10 Mar 2024 21:59:19 -0600 Subject: [PATCH] Avance4 --- ventana1.java | 11 ++++ ventana2.form | 155 ++++++++++++++++++++++++++++++++++++++++++++++++++ ventana2.java | 15 +++++ 3 files changed, 181 insertions(+) create mode 100644 ventana2.form create mode 100644 ventana2.java diff --git a/ventana1.java b/ventana1.java index 8bfe28d..b1cadfb 100644 --- a/ventana1.java +++ b/ventana1.java @@ -8,6 +8,7 @@ public class ventana1 { private JButton iniciarBoton; private JButton registerBoton; private JPasswordField contrasenal; + private JPanel panelPrincipal; private JLabel usuarioLabel; private JLabel contrasenaLabel; private JLabel inicioText; @@ -26,6 +27,16 @@ public class ventana1 { if (user != null) { JOptionPane.showMessageDialog(null, "Inicio de sesión exitoso"); // Aquí puedes realizar otras acciones después de iniciar sesión correctamente + // Obtener el JFrame actual y cerrarlo + JFrame frame = (JFrame) SwingUtilities.getWindowAncestor(panel); + frame.dispose(); + + // Mostrar el panel de inicio de sesión + JFrame principalFrame = new JFrame("Principal"); + principalFrame.setContentPane(new ventana2().panel); + principalFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); + principalFrame.pack(); + principalFrame.setVisible(true); } else { JOptionPane.showMessageDialog(null, "Usuario o contraseña incorrectos"); } diff --git a/ventana2.form b/ventana2.form new file mode 100644 index 0000000..73601a9 --- /dev/null +++ b/ventana2.form @@ -0,0 +1,155 @@ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/ventana2.java b/ventana2.java new file mode 100644 index 0000000..b1a2c35 --- /dev/null +++ b/ventana2.java @@ -0,0 +1,15 @@ +import javax.swing.*; + +public class ventana2 { + JPanel panel; + private JButton comprarBoletosButton; + private JButton carteleraButton; + private JButton cerrarSesiónButton; + private JButton button1; + private JButton button2; + private JButton button3; + private JButton button4; + private JButton button5; + private JButton button6; + private JScrollBar scrollBar1; +}