0% found this document useful (0 votes)
54 views14 pages

Categorias Codigp

This document contains the code for a Java GUI application that displays and allows purchasing of different video game products. It imports connection classes and defines a Categorias JFrame class with methods to initialize the form and handle user interactions like selecting product categories and clicking purchase buttons. The form displays panels with images and details of games like COD, F1, Super Mario Bros, and allows adding them to a cart with button clicks.

Uploaded by

Oscar Vega
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
54 views14 pages

Categorias Codigp

This document contains the code for a Java GUI application that displays and allows purchasing of different video game products. It imports connection classes and defines a Categorias JFrame class with methods to initialize the form and handle user interactions like selecting product categories and clicking purchase buttons. The form displays panels with images and details of games like COD, F1, Super Mario Bros, and allows adding them to a cart with button clicks.

Uploaded by

Oscar Vega
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 14

/*

* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to
change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/GUIForms/JFrame.java to edit this
template
*/
package com.mycompany.proyectofinal;

import java.sql.Connection;

/**
*
* @author DELL
*/
public class Categorias extends javax.swing.JFrame {

/**
* Creates new form Categorias
*/

Conexion con;
Connection condb;
CRUDSqlServer crud;

public Categorias() {
initComponents();
con = new Conexion();
condb = con.ObtenerConexion();
crud = new CRUDSqlServer();
}

/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">

private void initComponents() {

jLabel1 = new javax.swing.JLabel();


Tprod = new javax.swing.JComboBox<>();
jLabel2 = new javax.swing.JLabel();
Panelj = new javax.swing.JPanel();
jLabel5 = new javax.swing.JLabel();
COD = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
F1 = new javax.swing.JButton();
jLabel7 = new javax.swing.JLabel();
FC = new javax.swing.JButton();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
jLabel14 = new javax.swing.JLabel();
jLabel15 = new javax.swing.JLabel();
mariobros = new javax.swing.JButton();
jLabel16 = new javax.swing.JLabel();
jLabel17 = new javax.swing.JLabel();
SpiderMan = new javax.swing.JButton();
Panelc = new javax.swing.JPanel();
jLabel4 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
Comprar_ps1 = new javax.swing.JButton();
jLabel18 = new javax.swing.JLabel();
comprar_ps5 = new javax.swing.JButton();
jLabel19 = new javax.swing.JLabel();
jLabel20 = new javax.swing.JLabel();
jButton7 = new javax.swing.JButton();
jLabel21 = new javax.swing.JLabel();
jLabel22 = new javax.swing.JLabel();
jLabel23 = new javax.swing.JLabel();
Comprar_Nintendos = new javax.swing.JButton();
jLabel24 = new javax.swing.JLabel();
jLabel25 = new javax.swing.JLabel();
Comprar_seriess = new javax.swing.JButton();
Regresar = new javax.swing.JButton();
jButton2 = new javax.swing.JButton();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

jLabel1.setFont(new java.awt.Font("SansSerif", 1, 36)); // NOI18N


jLabel1.setText("Productos a la venta");

Tprod.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Ver


Todo", "Consolas", "Juegos" }));
Tprod.addItemListener(new java.awt.event.ItemListener() {
public void itemStateChanged(java.awt.event.ItemEvent evt) {
TprodItemStateChanged(evt);
}
});
Tprod.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
TprodActionPerformed(evt);
}
});

jLabel2.setFont(new java.awt.Font("SansSerif", 0, 14)); // NOI18N


jLabel2.setText("Filtro ");

Panelj.setBorder(javax.swing.BorderFactory.createTitledBorder("Juegos"));

jLabel5.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\SGBD\\
Captura_J1C.PNG")); // NOI18N

COD.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\SGBD\\
anadir-al-carrito.png")); // NOI18N
COD.setText("comprar");
COD.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
CODActionPerformed(evt);
}
});

jLabel3.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\SGBD\\
Captura_J2A.PNG")); // NOI18N

F1.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\SGBD\\
anadir-al-carrito.png")); // NOI18N
F1.setText("Comprar");
F1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
F1ActionPerformed(evt);
}
});

jLabel7.setText("Produc03");

FC.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\SGBD\\
anadir-al-carrito.png")); // NOI18N
FC.setText("Comprar");
FC.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
FCActionPerformed(evt);
}
});

jLabel10.setText("COD Vanguard, $270.000");

jLabel11.setText("F1, $100.000");

jLabel12.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\Captura_FC.PNG")); // NOI18N

jLabel13.setText("FC 24, $150.000 ");

jLabel14.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\Captura_Mb.PNG")); // NOI18N

jLabel15.setText("Super Mario Bros");

mariobros.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\anadir-al-carrito.png")); // NOI18N
mariobros.setText("Comprar");
mariobros.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
mariobrosActionPerformed(evt);
}
});

jLabel16.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\Captura_SM.PNG")); // NOI18N

jLabel17.setText("Spider - Man 2");

SpiderMan.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\anadir-al-carrito.png")); // NOI18N
SpiderMan.setText("Comprar");
SpiderMan.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
SpiderManActionPerformed(evt);
}
});

javax.swing.GroupLayout PaneljLayout = new javax.swing.GroupLayout(Panelj);


Panelj.setLayout(PaneljLayout);
PaneljLayout.setHorizontalGroup(

PaneljLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PaneljLayout.createSequentialGroup()
.addGap(26, 26, 26)
.addGroup(PaneljLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addComponent(jLabel10)
.addComponent(jLabel5)
.addComponent(COD))
.addGroup(PaneljLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addGroup(PaneljLayout.createSequentialGroup()
.addGap(18, 18, 18)
.addGroup(PaneljLayout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.LEADING)
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 154,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
PaneljLayout.createSequentialGroup()
.addComponent(F1)
.addGap(20, 20, 20))))
.addGroup(PaneljLayout.createSequentialGroup()
.addGap(66, 66, 66)
.addComponent(jLabel11)))
.addGroup(PaneljLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addGroup(PaneljLayout.createSequentialGroup()
.addGap(57, 57, 57)
.addGroup(PaneljLayout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.TRAILING)
.addComponent(FC)
.addComponent(jLabel13))
.addGap(82, 82, 82)
.addGroup(PaneljLayout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.LEADING)
.addGroup(PaneljLayout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(mariobros)
.addGroup(PaneljLayout.createParallelGroup(javax.sw
ing.GroupLayout.Alignment.LEADING, false)
.addGroup(PaneljLayout.createSequentialGroup()
.addGap(593, 593, 593)
.addComponent(jLabel7))
.addGroup(javax.swing.GroupLayout.Alignment.TRA
ILING, PaneljLayout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.Co
mponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(PaneljLayout.createParallelGroup(
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel17)
.addComponent(SpiderMan))
.addGap(472, 472, 472))))
.addComponent(jLabel15)))
.addGroup(PaneljLayout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jLabel12)
.addGap(35, 35, 35)
.addComponent(jLabel14)
.addGap(41, 41, 41)
.addComponent(jLabel16,
javax.swing.GroupLayout.PREFERRED_SIZE, 151,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
PaneljLayout.setVerticalGroup(

PaneljLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
PaneljLayout.createSequentialGroup()
.addContainerGap()
.addGroup(PaneljLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addGroup(PaneljLayout.createSequentialGroup()
.addComponent(jLabel5,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addGap(91, 91, 91))
.addGroup(PaneljLayout.createSequentialGroup()
.addComponent(jLabel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 177,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(PaneljLayout.createSequentialGroup()
.addGroup(PaneljLayout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.LEADING)
.addGroup(PaneljLayout.createSequentialGroup()
.addGroup(PaneljLayout.createParallelGroup(javax.sw
ing.GroupLayout.Alignment.LEADING, false)
.addComponent(jLabel14,
javax.swing.GroupLayout.DEFAULT_SIZE, 196, Short.MAX_VALUE)
.addComponent(jLabel12,
javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addGap(14, 14, 14)
.addGroup(PaneljLayout.createParallelGroup(javax.sw
ing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel13)
.addComponent(jLabel15)
.addComponent(jLabel10)
.addComponent(jLabel11))
.addPreferredGap(javax.swing.LayoutStyle.ComponentP
lacement.UNRELATED)
.addGroup(PaneljLayout.createParallelGroup(javax.sw
ing.GroupLayout.Alignment.BASELINE)
.addComponent(FC)
.addComponent(mariobros)
.addComponent(F1)
.addComponent(COD)))
.addGroup(PaneljLayout.createSequentialGroup()
.addComponent(jLabel16,
javax.swing.GroupLayout.PREFERRED_SIZE, 205,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentP
lacement.RELATED)
.addComponent(jLabel17)
.addPreferredGap(javax.swing.LayoutStyle.ComponentP
lacement.UNRELATED)
.addComponent(SpiderMan)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))))
.addGroup(PaneljLayout.createSequentialGroup()
.addGap(105, 105, 105)
.addComponent(jLabel7)
.addGap(0, 0, Short.MAX_VALUE))
);

Panelc.setBorder(javax.swing.BorderFactory.createTitledBorder("Consolas"));

jLabel4.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\SGBD\\
play 1.PNG")); // NOI18N

jLabel6.setText("Play Station 1,$450.000");

Comprar_ps1.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\anadir-al-carrito.png")); // NOI18N
Comprar_ps1.setText("Comprar");
Comprar_ps1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Comprar_ps1ActionPerformed(evt);
}
});

jLabel18.setText("Play Station 5, $2.000.000");

comprar_ps5.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\anadir-al-carrito.png")); // NOI18N
comprar_ps5.setText("Comprar");
comprar_ps5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
comprar_ps5ActionPerformed(evt);
}
});

jLabel19.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\play 5.PNG")); // NOI18N

jLabel20.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\play 3.PNG")); // NOI18N

jButton7.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\anadir-al-carrito.png")); // NOI18N
jButton7.setText("Comprar");
jButton7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton7ActionPerformed(evt);
}
});

jLabel21.setText("Play Station 3,$700.000");


jLabel22.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\nintendo s.PNG")); // NOI18N

jLabel23.setText("Nintendo Switch");

Comprar_Nintendos.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\
Desktop\\SGBD\\anadir-al-carrito.png")); // NOI18N
Comprar_Nintendos.setText("Comprar");
Comprar_Nintendos.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Comprar_NintendosActionPerformed(evt);
}
});

jLabel24.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\series s.PNG")); // NOI18N

jLabel25.setText("Xbox Series S");

Comprar_seriess.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\
Desktop\\SGBD\\anadir-al-carrito.png")); // NOI18N
Comprar_seriess.setText("Comprar");
Comprar_seriess.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Comprar_seriessActionPerformed(evt);
}
});

javax.swing.GroupLayout PanelcLayout = new javax.swing.GroupLayout(Panelc);


Panelc.setLayout(PanelcLayout);
PanelcLayout.setHorizontalGroup(

PanelcLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelcLayout.createSequentialGroup()
.addGroup(PanelcLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.TRAILING)
.addComponent(jLabel6)
.addGroup(PanelcLayout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(PanelcLayout.createSequentialGroup()
.addGap(15, 15, 15)
.addComponent(jLabel4,
javax.swing.GroupLayout.PREFERRED_SIZE, 135,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(PanelcLayout.createSequentialGroup()
.addGap(46, 46, 46)
.addComponent(Comprar_ps1))))
.addGroup(PanelcLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING)
.addGroup(PanelcLayout.createSequentialGroup()
.addGap(38, 38, 38)
.addGroup(PanelcLayout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.LEADING, false)
.addComponent(jLabel18,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jLabel19,
javax.swing.GroupLayout.PREFERRED_SIZE, 0, Short.MAX_VALUE))
.addGap(42, 42, 42)
.addComponent(jLabel20,
javax.swing.GroupLayout.PREFERRED_SIZE, 133,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(31, 31, 31)
.addComponent(jLabel22,
javax.swing.GroupLayout.PREFERRED_SIZE, 150,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(45, 45, 45)
.addComponent(jLabel24,
javax.swing.GroupLayout.PREFERRED_SIZE, 130,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(31, Short.MAX_VALUE))
.addGroup(PanelcLayout.createSequentialGroup()
.addGap(63, 63, 63)
.addComponent(comprar_ps5)
.addGap(80, 80, 80)
.addGroup(PanelcLayout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.LEADING, false)
.addGroup(PanelcLayout.createSequentialGroup()
.addComponent(jLabel21)
.addGap(64, 64, 64)
.addComponent(jLabel23))
.addGroup(PanelcLayout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(jButton7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentP
lacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Comprar_Nintendos)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement
.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(PanelcLayout.createParallelGroup(javax.swing.Grou
pLayout.Alignment.LEADING)
.addComponent(jLabel25)
.addComponent(Comprar_seriess))
.addGap(49, 49, 49))))
);
PanelcLayout.setVerticalGroup(

PanelcLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(PanelcLayout.createSequentialGroup()
.addGap(16, 16, 16)
.addGroup(PanelcLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.LEADING, false)
.addComponent(jLabel24, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel22, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel20, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE,
152, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel19, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addGap(18, 18, 18)
.addGroup(PanelcLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(jLabel6)
.addComponent(jLabel18)
.addComponent(jLabel21)
.addComponent(jLabel23)
.addComponent(jLabel25))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED
, 12, Short.MAX_VALUE)
.addGroup(PanelcLayout.createParallelGroup(javax.swing.GroupLayout.
Alignment.BASELINE)
.addComponent(Comprar_ps1)
.addComponent(comprar_ps5)
.addComponent(jButton7)
.addComponent(Comprar_Nintendos)
.addComponent(Comprar_seriess))
.addGap(29, 29, 29))
);

Regresar.setFont(new java.awt.Font("SansSerif", 0, 12)); // NOI18N


Regresar.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\Regresar mini.png")); // NOI18N
Regresar.setText("Salir");
Regresar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
RegresarActionPerformed(evt);
}
});

jButton2.setText("Carrito");
jButton2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
}
});

jLabel8.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\SGBD\\
Captura_P1.PNG")); // NOI18N

jLabel9.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\SGBD\\
filtrar.png")); // NOI18N

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addGap(0, 0, Short.MAX_VALUE)
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 817,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(36, 36, 36))
.addGroup(layout.createSequentialGroup()
.addGap(384, 384, 384)
.addComponent(jLabel9)
.addGap(18, 18, 18)
.addComponent(jLabel2)
.addGap(30, 30, 30)
.addComponent(Tprod, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
.addGroup(layout.createSequentialGroup()
.addContainerGap(24, Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addComponent(jLabel1)
.addComponent(Panelj, javax.swing.GroupLayout.PREFERRED_SIZE,
891, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Regresar)
.addComponent(Panelc, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addContainerGap(24, Short.MAX_VALUE))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addComponent(jButton2)
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(Regresar, javax.swing.GroupLayout.PREFERRED_SIZE, 29,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT
ED)
.addComponent(jLabel8, javax.swing.GroupLayout.PREFERRED_SIZE, 14,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT
ED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 28,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addComponent(jLabel9)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Al
ignment.BASELINE)
.addComponent(jLabel2)
.addComponent(Tprod,
javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED
)
.addComponent(Panelj, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELAT
ED)
.addComponent(Panelc, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED
)
.addComponent(jButton2)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

pack();
}// </editor-fold>
private void TprodItemStateChanged(java.awt.event.ItemEvent evt) {

// TODO add your handling code here:


// TODO add your handling code here:
String nombre = Tprod.getSelectedItem().toString();

if(nombre.equals("Ver Todo")) {
// Mostrar todos los paneles
Panelj.setVisible(true);
Panelc.setVisible(true);
// OtrosPaneles.setVisible(true);
} else if (nombre.equals("Juegos")) {
// Mostrar solo el panel de Consolas
Panelj.setVisible(true);
Panelc.setVisible(false);
// OtrosPaneles.setVisible(false);
} else if (nombre.equals("Consolas")) {
// Mostrar solo el panel de Videojuegos
Panelj.setVisible(false);
Panelc.setVisible(true);
// OtrosPaneles.setVisible(false);
}
}

private void TprodActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


}

private void RegresarActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


System.exit(0);
}

private void CODActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:

Productos p = crud.GetProductos(condb, 1);


System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);

private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


}

private void F1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 2);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}
private void FCActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 8);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}

private void mariobrosActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 9);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}

private void SpiderManActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 10);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}

private void Comprar_ps1ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 3);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}

private void comprar_ps5ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 4);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}

private void jButton7ActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 5);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}

private void Comprar_NintendosActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 6);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}

private void Comprar_seriessActionPerformed(java.awt.event.ActionEvent evt) {

// TODO add your handling code here:


Productos p = crud.GetProductos(condb, 7);
System.out.println("e ="+ p.getNombre());

crud.InsertarProdutoTemp(condb, p);
}

/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code
(optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the
default look and feel.
* For details see
http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {

java.util.logging.Logger.getLogger(Categorias.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {

java.util.logging.Logger.getLogger(Categorias.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {

java.util.logging.Logger.getLogger(Categorias.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {

java.util.logging.Logger.getLogger(Categorias.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
}
//</editor-fold>

/* Create and display the form */


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Categorias().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton COD;
private javax.swing.JButton Comprar_Nintendos;
private javax.swing.JButton Comprar_ps1;
private javax.swing.JButton Comprar_seriess;
private javax.swing.JButton F1;
private javax.swing.JButton FC;
private javax.swing.JPanel Panelc;
private javax.swing.JPanel Panelj;
private javax.swing.JButton Regresar;
private javax.swing.JButton SpiderMan;
private javax.swing.JComboBox<String> Tprod;
private javax.swing.JButton comprar_ps5;
private javax.swing.JButton jButton2;
private javax.swing.JButton jButton7;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel14;
private javax.swing.JLabel jLabel15;
private javax.swing.JLabel jLabel16;
private javax.swing.JLabel jLabel17;
private javax.swing.JLabel jLabel18;
private javax.swing.JLabel jLabel19;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel20;
private javax.swing.JLabel jLabel21;
private javax.swing.JLabel jLabel22;
private javax.swing.JLabel jLabel23;
private javax.swing.JLabel jLabel24;
private javax.swing.JLabel jLabel25;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JButton mariobros;
// End of variables declaration
}

You might also like