This commit is contained in:
Roberto 2024-03-10 21:59:19 -06:00
parent ffb81d77dc
commit 70f60810d0
3 changed files with 181 additions and 0 deletions

View File

@ -8,6 +8,7 @@ public class ventana1 {
private JButton iniciarBoton; private JButton iniciarBoton;
private JButton registerBoton; private JButton registerBoton;
private JPasswordField contrasenal; private JPasswordField contrasenal;
private JPanel panelPrincipal;
private JLabel usuarioLabel; private JLabel usuarioLabel;
private JLabel contrasenaLabel; private JLabel contrasenaLabel;
private JLabel inicioText; private JLabel inicioText;
@ -26,6 +27,16 @@ public class ventana1 {
if (user != null) { if (user != null) {
JOptionPane.showMessageDialog(null, "Inicio de sesión exitoso"); JOptionPane.showMessageDialog(null, "Inicio de sesión exitoso");
// Aquí puedes realizar otras acciones después de iniciar sesión correctamente // 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 { } else {
JOptionPane.showMessageDialog(null, "Usuario o contraseña incorrectos"); JOptionPane.showMessageDialog(null, "Usuario o contraseña incorrectos");
} }

155
ventana2.form Normal file
View File

@ -0,0 +1,155 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="ventana2">
<grid id="27dc6" layout-manager="GridLayoutManager" row-count="6" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="856" height="592"/>
</constraints>
<properties>
<background color="-4527617"/>
<foreground color="-3349030"/>
<preferredSize width="1920" height="1080"/>
<visible value="true"/>
</properties>
<border type="none"/>
<children>
<component id="c960e" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="Máscaras-de-Teatro (1).jpg"/>
<text value=""/>
</properties>
</component>
<grid id="21365" layout-manager="GridLayoutManager" row-count="3" column-count="3" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<grid row="2" column="0" row-span="4" col-span="1" vsize-policy="3" hsize-policy="3" anchor="0" fill="3" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="c64dc" class="javax.swing.JButton" binding="button1" default-binding="true">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="divinacomedia (1).jpg"/>
<text value=""/>
</properties>
</component>
<component id="7ceba" class="javax.swing.JButton" binding="button2" default-binding="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="romeo-y-julieta (1).jpg"/>
<text value=""/>
</properties>
</component>
<component id="41766" class="javax.swing.JButton" binding="button3" default-binding="true">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="espera (1).jpg"/>
<text value=""/>
</properties>
</component>
<component id="9bb7f" class="javax.swing.JButton" binding="button4" default-binding="true">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="fantasOpera (1).png"/>
<text value=""/>
</properties>
</component>
<component id="8d4f" class="javax.swing.JButton" binding="button5" default-binding="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="nostalgia (1).jpg"/>
<text value=""/>
</properties>
</component>
<component id="62051" class="javax.swing.JButton" binding="button6" default-binding="true">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<icon value="quijote (1).jpg"/>
<text value=""/>
</properties>
</component>
<component id="ffae7" class="javax.swing.JScrollBar" binding="scrollBar1" default-binding="true">
<constraints>
<grid row="0" column="2" row-span="3" col-span="1" vsize-policy="6" hsize-policy="0" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<orientation value="1"/>
</properties>
</component>
</children>
</grid>
<component id="dc6aa" class="javax.swing.JButton" binding="comprarBoletosButton" default-binding="true">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Comprar Boletos"/>
</properties>
</component>
<component id="fce23" class="javax.swing.JButton" binding="carteleraButton" default-binding="true">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Cartelera"/>
</properties>
</component>
<component id="f9c98" class="javax.swing.JButton" binding="cerrarSesiónButton" default-binding="true">
<constraints>
<grid row="4" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="3" anchor="0" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<text value="Cerrar sesión"/>
</properties>
</component>
<component id="6b1b7" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Arial Black" size="24" style="2"/>
<foreground color="-16777216"/>
<text value="Ticketmania - Teatro del Estado"/>
</properties>
</component>
<component id="1c50d" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Arial Black" size="14" style="2"/>
<foreground color="-16777216"/>
<text value="Cartelera"/>
</properties>
</component>
<component id="76bd0" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="0" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Arial Black" size="14" style="2"/>
<foreground color="-16777216"/>
<horizontalAlignment value="0"/>
<horizontalTextPosition value="0"/>
<text value="Menus"/>
</properties>
</component>
</children>
</grid>
</form>

15
ventana2.java Normal file
View File

@ -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;
}