Categorias Codigp
Categorias Codigp
* 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">
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
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);
}
});
jLabel11.setText("F1, $100.000");
jLabel12.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\Captura_FC.PNG")); // NOI18N
jLabel14.setIcon(new javax.swing.ImageIcon("C:\\Users\\DELL\\Desktop\\
SGBD\\Captura_Mb.PNG")); // NOI18N
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
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);
}
});
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
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);
}
});
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);
}
});
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
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);
}
});
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))
);
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
pack();
}// </editor-fold>
private void TprodItemStateChanged(java.awt.event.ItemEvent evt) {
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);
}
}
crud.InsertarProdutoTemp(condb, p);
crud.InsertarProdutoTemp(condb, p);
}
private void FCActionPerformed(java.awt.event.ActionEvent evt) {
crud.InsertarProdutoTemp(condb, p);
}
crud.InsertarProdutoTemp(condb, p);
}
crud.InsertarProdutoTemp(condb, p);
}
crud.InsertarProdutoTemp(condb, p);
}
crud.InsertarProdutoTemp(condb, p);
}
crud.InsertarProdutoTemp(condb, p);
}
crud.InsertarProdutoTemp(condb, p);
}
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>