SlideShare a Scribd company logo
1 of 44
Download to read offline
ENTORNO NETBEANS
Diapositiva 1
ENTORNO DE
NETBEANS PROGRAMACIÓN VIII
MARLON ARANA
8 “B”
Diapositiva 2
NETBEANS
■ Netbeans es un entorno de desarrollo gratuito y de código abierto que
Permite el uso de un amplio rango de tecnologías de desarrollo tanto
para escritorio, como aplicaciones Web, o para dispositivos móviles.
Da soporte a las siguientes tecnologías, entre
otras: Java, PHP, Groovy, C/C++, HTML5,... Además puede instalarse
en varios sistemas operativos: Windows, Linux, Mac OS
Diapositiva 3
Entorno de Netbeans
■ Dentro del programa, una vez escogido la clase de proyecto en mi caso java
Application, encontramos la siguiente pantalla con las siguientes partes:
Diapositiva 4
Entorno de Netbeans
En este entorno se muestra las herramientas básicas para utilizar
Diapositiva 5
Entorno de Netbeans
■ En la anterior pantalla, se da nombre al proyecto y se escoge la ubicación donde se
va a guardar el proyecto, para una vez terminado el proyecto o código podamos
ejecutarlo con el botón verde, como muestra la imagen.
Diapositiva 6
Entorno de Netbeans
Aquí en la parte de profile
TRABAJO AUTONOMO MAYO
public class Operador_AND_ejercicio_a extends javax.swing.JFrame {
/**
* Creates new form Operador_AND_ejercicio_c
*/
public Operador_AND_ejercicio_a() {
initComponents();
}
/**
* 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() {
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
jButton1 = new javax.swing.JButton();
jLabel3 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel4.setText(" ");
jLabel5.setText("a = 5 y b = 15");
jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel6.setText(" ");
jLabel1.setText("Operador AND");
jLabel2.setText("(a > 5) AND (b < a)");
jButton1.setText("Calcular");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
jLabel3.setText(" ");
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(144, 144, 144)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(143, 143, 143)
.addComponent(jLabel5))
.addGroup(layout.createSequentialGroup()
.addGap(129, 129, 129)
.addComponent(jLabel2))
.addGroup(layout.createSequentialGroup()
.addGap(144, 144, 144)
.addComponent(jButton1))
.addGroup(layout.createSequentialGroup()
.addGap(110, 110, 110)
.addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(150, 150, 150)
.addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(150, 150, 150)
.addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(16, 16, 16)
.addComponent(jLabel1)
.addGap(7, 7, 7)
.addComponent(jLabel5)
.addGap(9, 9, 9)
.addComponent(jLabel2)
.addGap(9, 9, 9)
.addComponent(jButton1)
.addGap(20, 20, 20)
.addComponent(jLabel3)
.addGap(20, 20, 20)
.addComponent(jLabel6)
.addGap(10, 10, 10)
.addComponent(jLabel4))
);
pack();
}// </editor-fold>
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int a=5,b=15;
jLabel3.setText(String.valueOf("("+a+" > "+a+")"+" AND "+"("+b+" < "+a+")"));
jLabel6.setText("Falso AND Falso");
jLabel4.setText("Falso");
// TODO add your handling code here:
}
/**
* @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(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null,
ex);
}
//</editor-fold>
//</editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Operador_AND_ejercicio_a().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton jButton1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
// End of variables declaration
}
Deber sentencias de control
Realizar un login con nombre y usuario, dentro de este debe haber un menú
• Diseñar y Generar los cinco formularios
• Crear las operaciones
package javaapplication2;
import javax.swing.JOptionPane;
public class NewJFrame extends javax.swing.JFrame {
public NewJFrame() {
initComponents();
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
entrar = new javax.swing.JButton();
jTextField1 = new javax.swing.JTextField();
jpassClave = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
jLabel1.setText("usuario");
jLabel2.setText("contraseña");
entrar.setText("entrar");
entrar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
entrarActionPerformed(evt);
}
});
jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N
jLabel3.setText("USUARIO");
jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fotos/12333.jpg"))); // NOI18N
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(55, 55, 55)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jLabel1)
.addComponent(jLabel2))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 69,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jpassClave, javax.swing.GroupLayout.PREFERRED_SIZE, 69,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(103, 103, 103))
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(161, 161, 161)
.addComponent(jLabel3))
.addGroup(layout.createSequentialGroup()
.addGap(101, 101, 101)
.addComponent(jLabel4))
.addGroup(layout.createSequentialGroup()
.addGap(139, 139, 139)
.addComponent(entrar)))
.addContainerGap(124, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(6, 6, 6)
.addComponent(jLabel4)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel1)
.addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(jpassClave, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(entrar)
.addContainerGap(130, Short.MAX_VALUE))
);
pack();
}// </editor-fold>
private void entrarActionPerformed(java.awt.event.ActionEvent evt) {
String usuario ="marlon", clave = "12345";
if (jTextField1.getText().equals(usuario) && jpassClave.getText().equals(clave)){
this.dispose();
JOptionPane.showMessageDialog(null, "Bienvenidon"
+ "Has ingresado satisfactoriamente al sistema", "Mensaje de bienvenida",
JOptionPane.INFORMATION_MESSAGE);
menu abrir=new menu();
abrir.setVisible(true);
}else {
JOptionPane.showMessageDialog(null, "Acceso denegado:n"
+ "Por favor ingrese un usuario y/o contraseña correctos", "Acceso denegado",
JOptionPane.ERROR_MESSAGE);
} // TODO add your handling code here:
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new NewJFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton entrar;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JTextField jTextField1;
private javax.swing.JTextField jpassClave;
// End of variables declaration
}
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
double n1,r;
n1=Double.parseDouble(jTextField1.getText());
r=n1%2;
if(r==0)
jLabel2.setText("EL NUMERO "+n1+" ES: PAR");
else
jLabel2.setText("EL NUMERO "+n1+" ES: IMPAR");
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int a,b=1,c=0, resultado;
int num1=4;
int num2=2;
int num3=3;
int num4=10;
a=num1-num2;
for (int i=1; i<=3; i++)
{
b=b*a;
c=b*num1;
}
resultado= c+num4;
jTextField1.setText(String.valueOf(resultado));
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
float d,a,b=1, c=0, resultado;
float num1=4;
int num2=2;
int num3=3;
int num4=10;
float num5=6;
d= num5/num1;
a=d-num2;
for (int i=1; i<=3; i++)
{
b=b*a;
c=b*num1;
}
resultado= c+num4;
jTextField2.setText(String.valueOf(resultado));
}
private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {
double d,b,e,r, c=1, resultado;
double num2=3;
double a, num3=2 ;
int num1=7;
int num4=1;
d= num2/num3;
a=d+num4;
c=Math.pow(num3, a);
b=Math.pow(num2, c);
e=num1%num2;
resultado=b+e;
/*jTextField3.setText(String.valueOf(resultado));*/
jTextField3.setText(""+resultado);
ARREGLOS – VALIDACIÓN DE CÉDULA
Realizar una consulta sobre la validación de la cédula realizar el programa en java con
formularios con menú
private void jLabel5MouseClicked(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
String cedu=jTextField1.getText();
String [] division=cedu.split("");
int dg1,dg2,dg3,dg4,dg5,dg6,dg7,dg8,dg9;
int op1,op2,op3,op4,op5,op6,op7,op8,op9;
int suma=0, res=0, dgvericador;
if (cedu.length()==10){
dg1=Integer.parseInt(division[division.length-10]);
dg2=Integer.parseInt(division[division.length-9]);
dg3=Integer.parseInt(division[division.length-8]);
dg4=Integer.parseInt(division[division.length-7]);
dg5=Integer.parseInt(division[division.length-6]);
dg6=Integer.parseInt(division[division.length-5]);
dg7=Integer.parseInt(division[division.length-4]);
dg8=Integer.parseInt(division[division.length-3]);
dg9=Integer.parseInt(division[division.length-2]);
dgvericador=Integer.parseInt(division[division.length-1]);
jLabel2.setText("Cedula Ingresada "+dg1+" "+dg2+" "+dg3+" "+dg4+" "+dg5+"
"+dg6+" "+dg7+" "+dg8+" "+dg9+" "+dgvericador);
op1=dg1*2;
if (op1>=10){
op1 =op1-9;
}
op2=dg2*1;
op3=dg3*2;
if (op3>=10){
op3 = op3- 9;
}
op4=dg4*1;
op5=dg5*2;
if (op5>=10){
op5=op5- 9;
}
op6=dg6*1;
op7=dg7*2;
if (op7>=10){
op7=op7- 9;
}
op8=dg8*1;
op9=dg9*2;
if (op9>=10){
op9=op9-9;
}
suma=op1+op2+op3+op4+op5+op6+op7+op8+op9;
res=suma % 10;
if (res==dgvericador){
JOptionPane.showMessageDialog(null, "Cedula Correcta");
jTextField1.setText(null);
}
else {
JOptionPane.showMessageDialog(null, "Cedula Incorrecta");
jTextField1.setText(null);
}
}
else{
JOptionPane.showMessageDialog(null, "Cedula Incompleta");}
}
private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) {
int maximodeletras=10;
if(jTextField1.getText().length()>=maximodeletras){
evt.consume();
JOptionPane.showMessageDialog(rootPane, "Solo 10 Digitos");
}
JUEGO DE CARTAS
private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
int ne=0,i;
if (jCheckBox1.isSelected())
ne=ne+16;
if (jCheckBox2.isSelected())
ne=ne+32;
if (jCheckBox3.isSelected())
ne=ne+8;
if (jCheckBox4.isSelected())
ne=ne+1;
if (jCheckBox5.isSelected())
ne=ne+2;
if (jCheckBox6.isSelected())
ne=ne+4;
jTextField1.setText(""+ne);
}
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
System.exit(0);
JUEGO DE MEMORIA
package gui;
import auxiliar.LogicaJuego;
import java.awt.BorderLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JOptionPane;
import javax.swing.plaf.OptionPaneUI;
/**
*
* @author Dark
*/
public class PlayGame extends javax.swing.JFrame {
private VFondo fondo;
private LogicaJuego log = new LogicaJuego();
private boolean caraUp = false;
private ImageIcon im1;
private ImageIcon im2;
private JButton[] pbtn = new JButton[2];
private boolean primerc = false;
private int puntaje = 0;
public PlayGame() {
initComponents();
fondo = new VFondo(getWidth(), getHeight());
add(fondo, BorderLayout.CENTER);
setCards();
}
private void setCards() {
int[] numbers = log.getCardNumbers();
/* reemplazar el uso de "../imagenes/..." por "/imagenes/..." */
btnC1.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[0] + ".jpg")));
btnC2.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[1] + ".jpg")));
btnC3.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[2] + ".jpg")));
btnC4.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[3] + ".jpg")));
btnC5.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[4] + ".jpg")));
btnC6.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[5] + ".jpg")));
btnC7.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[6] + ".jpg")));
btnC8.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[7] + ".jpg")));
btnC9.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[8] + ".jpg")));
btnC10.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[9] + ".jpg")));
btnC11.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[10] + ".jpg")));
btnC12.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[11] + ".jpg")));
btnC13.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[12] + ".jpg")));
btnC14.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[13] + ".jpg")));
btnC15.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[14] + ".jpg")));
btnC16.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" +
numbers[15] + ".jpg")));
}
private void btnEnabled(JButton btn) {
if (!caraUp) {
btn.setEnabled(false);
im1 = (ImageIcon) btn.getDisabledIcon();
pbtn[0] = btn;
caraUp = true;
primerc = false;
} else {
btn.setEnabled(false);
im2 = (ImageIcon) btn.getDisabledIcon();
pbtn[1] = btn;
primerc = true;
puntaje += 20;
pregwin();
}
}
private void compare() {
if (caraUp && primerc) {
if (im1.getDescription().compareTo(im2.getDescription()) != 0) {
pbtn[0].setEnabled(true);
pbtn[1].setEnabled(true);
if (puntaje > 10) {
puntaje -= 10;
}
}
caraUp = false;
}
}
private void reiniciar() {
btnC1.setEnabled(true);
btnC2.setEnabled(true);
btnC3.setEnabled(true);
btnC4.setEnabled(true);
btnC5.setEnabled(true);
btnC6.setEnabled(true);
btnC7.setEnabled(true);
btnC8.setEnabled(true);
btnC9.setEnabled(true);
btnC10.setEnabled(true);
btnC11.setEnabled(true);
btnC12.setEnabled(true);
btnC13.setEnabled(true);
btnC14.setEnabled(true);
btnC15.setEnabled(true);
btnC16.setEnabled(true);
primerc = false;
caraUp = false;
puntaje = 0;
}
private void pregwin() {
if (!btnC1.isEnabled() && !btnC2.isEnabled() && !btnC3.isEnabled() &&
!btnC4.isEnabled() && !btnC5.isEnabled() && !btnC6.isEnabled()
&& !btnC7.isEnabled() && !btnC8.isEnabled() && !btnC9.isEnabled() &&
!btnC10.isEnabled() && !btnC11.isEnabled()
&& !btnC12.isEnabled() && !btnC13.isEnabled() && !btnC14.isEnabled() &&
!btnC15.isEnabled() && !btnC16.isEnabled()) {
JOptionPane.showMessageDialog(this, "FELICIDADESn Usted ha ganado. Su
puntaje es: n" + puntaje, "Puntos!!", JOptionPane.INFORMATION_MESSAGE);
}
}
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
jLabel1 = new javax.swing.JLabel();
jPanel1 = new javax.swing.JPanel();
btnC1 = new javax.swing.JButton();
btnC2 = new javax.swing.JButton();
btnC3 = new javax.swing.JButton();
btnC4 = new javax.swing.JButton();
btnC8 = new javax.swing.JButton();
btnC7 = new javax.swing.JButton();
btnC6 = new javax.swing.JButton();
btnC5 = new javax.swing.JButton();
btnC12 = new javax.swing.JButton();
btnC11 = new javax.swing.JButton();
btnC10 = new javax.swing.JButton();
btnC9 = new javax.swing.JButton();
btnC16 = new javax.swing.JButton();
btnC15 = new javax.swing.JButton();
btnC14 = new javax.swing.JButton();
btnC13 = new javax.swing.JButton();
btnReiniciar = new javax.swing.JButton();
jButton1 = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setTitle("Juego Dos Caras");
jLabel1.setFont(new java.awt.Font("Tempus Sans ITC", 2, 18)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 51, 51));
jLabel1.setText("JUEGO MEMORIA");
jPanel1.setBackground(new java.awt.Color(102, 153, 255));
jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new
java.awt.Color(0, 0, 0)));
btnC1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC1.setBorder(null);
btnC1.setBorderPainted(false);
btnC1.setContentAreaFilled(false);
btnC1.setFocusable(false);
btnC1.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC1.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC1MouseExited(evt);
}
});
btnC1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC1ActionPerformed(evt);
}
});
btnC2.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC2.setBorder(null);
btnC2.setBorderPainted(false);
btnC2.setContentAreaFilled(false);
btnC2.setFocusable(false);
btnC2.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC2.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC2MouseExited(evt);
}
});
btnC2.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC2ActionPerformed(evt);
}
});
btnC3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC3.setBorder(null);
btnC3.setBorderPainted(false);
btnC3.setContentAreaFilled(false);
btnC3.setFocusable(false);
btnC3.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC3.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC3MouseExited(evt);
}
});
btnC3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC3ActionPerformed(evt);
}
});
btnC4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC4.setBorder(null);
btnC4.setBorderPainted(false);
btnC4.setContentAreaFilled(false);
btnC4.setFocusable(false);
btnC4.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC4.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC4MouseExited(evt);
}
});
btnC4.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC4ActionPerformed(evt);
}
});
btnC8.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC8.setBorder(null);
btnC8.setBorderPainted(false);
btnC8.setContentAreaFilled(false);
btnC8.setFocusable(false);
btnC8.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC8.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC8MouseExited(evt);
}
});
btnC8.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC8ActionPerformed(evt);
}
});
btnC7.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC7.setBorder(null);
btnC7.setBorderPainted(false);
btnC7.setContentAreaFilled(false);
btnC7.setFocusable(false);
btnC7.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC7.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC7MouseExited(evt);
}
});
btnC7.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC7ActionPerformed(evt);
}
});
btnC6.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC6.setBorder(null);
btnC6.setBorderPainted(false);
btnC6.setContentAreaFilled(false);
btnC6.setFocusable(false);
btnC6.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC6.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC6MouseExited(evt);
}
});
btnC6.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC6ActionPerformed(evt);
}
});
btnC5.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC5.setBorder(null);
btnC5.setBorderPainted(false);
btnC5.setContentAreaFilled(false);
btnC5.setFocusable(false);
btnC5.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC5.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC5MouseExited(evt);
}
});
btnC5.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC5ActionPerformed(evt);
}
});
btnC12.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC12.setBorder(null);
btnC12.setBorderPainted(false);
btnC12.setContentAreaFilled(false);
btnC12.setFocusable(false);
btnC12.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC12.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC12MouseExited(evt);
}
});
btnC12.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC12ActionPerformed(evt);
}
});
btnC11.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC11.setBorder(null);
btnC11.setBorderPainted(false);
btnC11.setContentAreaFilled(false);
btnC11.setFocusable(false);
btnC11.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC11.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC11MouseExited(evt);
}
});
btnC11.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC11ActionPerformed(evt);
}
});
btnC10.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC10.setBorder(null);
btnC10.setBorderPainted(false);
btnC10.setContentAreaFilled(false);
btnC10.setFocusable(false);
btnC10.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC10.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC10MouseExited(evt);
}
});
btnC10.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC10ActionPerformed(evt);
}
});
btnC9.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC9.setBorder(null);
btnC9.setBorderPainted(false);
btnC9.setContentAreaFilled(false);
btnC9.setFocusable(false);
btnC9.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC9.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC9MouseExited(evt);
}
});
btnC9.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC9ActionPerformed(evt);
}
});
btnC16.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC16.setBorder(null);
btnC16.setBorderPainted(false);
btnC16.setContentAreaFilled(false);
btnC16.setFocusable(false);
btnC16.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC16.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC16MouseExited(evt);
}
});
btnC16.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC16ActionPerformed(evt);
}
});
btnC15.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC15.setBorder(null);
btnC15.setBorderPainted(false);
btnC15.setContentAreaFilled(false);
btnC15.setFocusable(false);
btnC15.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC15.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC15MouseExited(evt);
}
});
btnC15.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC15ActionPerformed(evt);
}
});
btnC14.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC14.setBorder(null);
btnC14.setBorderPainted(false);
btnC14.setContentAreaFilled(false);
btnC14.setFocusable(false);
btnC14.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC14.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC14MouseExited(evt);
}
});
btnC14.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC14ActionPerformed(evt);
}
});
btnC13.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
btnC13.setBorder(null);
btnC13.setBorderPainted(false);
btnC13.setContentAreaFilled(false);
btnC13.setFocusable(false);
btnC13.setRolloverIcon(new
javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
btnC13.addMouseListener(new java.awt.event.MouseAdapter() {
public void mouseExited(java.awt.event.MouseEvent evt) {
btnC13MouseExited(evt);
}
});
btnC13.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnC13ActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel1Layout = new
javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnC1)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC4))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnC5)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC6)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC7)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC8))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnC9)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC10)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC11)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC12))
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(btnC13)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC14)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC15)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(btnC16)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(btnC2)
.addComponent(btnC1)
.addComponent(btnC3)
.addComponent(btnC4))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(btnC6)
.addComponent(btnC5)
.addComponent(btnC7)
.addComponent(btnC8))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(btnC9)
.addComponent(btnC10)
.addComponent(btnC11)
.addComponent(btnC12))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE
ADING)
.addComponent(btnC13)
.addComponent(btnC14)
.addComponent(btnC15)
.addComponent(btnC16))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
btnReiniciar.setBackground(new java.awt.Color(153, 255, 51));
btnReiniciar.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N
btnReiniciar.setText("VOLVER A INTENTARLO");
btnReiniciar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnReiniciarActionPerformed(evt);
}
});
jButton1.setBackground(new java.awt.Color(153, 255, 51));
jButton1.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N
jButton1.setText("SALIR");
jButton1.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new
javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(264, 264, 264)
.addComponent(jLabel1))
.addGroup(layout.createSequentialGroup()
.addGap(120, 120, 120)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(layout.createSequentialGroup()
.addGap(130, 130, 130)
.addComponent(btnReiniciar)
.addGap(49, 49, 49)
.addComponent(jButton1))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGap(12, 12, 12)
.addComponent(jLabel1)
.addGap(6, 6, 6)
.addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(4, 4, 4)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(btnReiniciar)
.addComponent(jButton1)))
);
setSize(new java.awt.Dimension(630, 520));
setLocationRelativeTo(null);
}// </editor-fold>
private void btnC1ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC1);
}
private void btnC2ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC2);
}
private void btnC3ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC3);
}
private void btnC4ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC4);
}
private void btnC5ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC5);
}
private void btnC6ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC6);
}
private void btnC7ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC7);
}
private void btnC8ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC8);
}
private void btnC9ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC9);
}
private void btnC10ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC10);
}
private void btnC11ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC11);
}
private void btnC12ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC12);
}
private void btnC13ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC13);
}
private void btnC14ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC14);
}
private void btnC15ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC15);
}
private void btnC16ActionPerformed(java.awt.event.ActionEvent evt) {
btnEnabled(btnC16);
}
private void btnC1MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC2MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC3MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC4MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC5MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC6MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC7MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC8MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC9MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC10MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC11MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC12MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
}
private void btnC13MouseExited(java.awt.event.MouseEvent evt) {
// TODO add your handling code here:
compare();
CLIENTE – SERVIDOR

More Related Content

Featured

How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
ThinkNow
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Trabajos autonomos

  • 1. ENTORNO NETBEANS Diapositiva 1 ENTORNO DE NETBEANS PROGRAMACIÓN VIII MARLON ARANA 8 “B” Diapositiva 2 NETBEANS ■ Netbeans es un entorno de desarrollo gratuito y de código abierto que Permite el uso de un amplio rango de tecnologías de desarrollo tanto para escritorio, como aplicaciones Web, o para dispositivos móviles. Da soporte a las siguientes tecnologías, entre otras: Java, PHP, Groovy, C/C++, HTML5,... Además puede instalarse en varios sistemas operativos: Windows, Linux, Mac OS Diapositiva 3
  • 2. Entorno de Netbeans ■ Dentro del programa, una vez escogido la clase de proyecto en mi caso java Application, encontramos la siguiente pantalla con las siguientes partes: Diapositiva 4 Entorno de Netbeans En este entorno se muestra las herramientas básicas para utilizar Diapositiva 5
  • 3. Entorno de Netbeans ■ En la anterior pantalla, se da nombre al proyecto y se escoge la ubicación donde se va a guardar el proyecto, para una vez terminado el proyecto o código podamos ejecutarlo con el botón verde, como muestra la imagen. Diapositiva 6 Entorno de Netbeans Aquí en la parte de profile
  • 4. TRABAJO AUTONOMO MAYO public class Operador_AND_ejercicio_a extends javax.swing.JFrame { /** * Creates new form Operador_AND_ejercicio_c */ public Operador_AND_ejercicio_a() { initComponents(); } /** * 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() { jLabel4 = new javax.swing.JLabel(); jLabel5 = new javax.swing.JLabel(); jLabel6 = new javax.swing.JLabel(); jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); jButton1 = new javax.swing.JButton();
  • 5. jLabel3 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel4.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel4.setText(" "); jLabel5.setText("a = 5 y b = 15"); jLabel6.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel6.setText(" "); jLabel1.setText("Operador AND"); jLabel2.setText("(a > 5) AND (b < a)"); jButton1.setText("Calcular"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); jLabel3.setHorizontalAlignment(javax.swing.SwingConstants.CENTER); jLabel3.setText(" "); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(144, 144, 144) .addComponent(jLabel1)) .addGroup(layout.createSequentialGroup() .addGap(143, 143, 143)
  • 6. .addComponent(jLabel5)) .addGroup(layout.createSequentialGroup() .addGap(129, 129, 129) .addComponent(jLabel2)) .addGroup(layout.createSequentialGroup() .addGap(144, 144, 144) .addComponent(jButton1)) .addGroup(layout.createSequentialGroup() .addGap(110, 110, 110) .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 160, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(150, 150, 150) .addComponent(jLabel6, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(150, 150, 150) .addComponent(jLabel4, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(16, 16, 16) .addComponent(jLabel1) .addGap(7, 7, 7) .addComponent(jLabel5) .addGap(9, 9, 9) .addComponent(jLabel2) .addGap(9, 9, 9) .addComponent(jButton1) .addGap(20, 20, 20) .addComponent(jLabel3) .addGap(20, 20, 20) .addComponent(jLabel6) .addGap(10, 10, 10) .addComponent(jLabel4)) );
  • 7. pack(); }// </editor-fold> private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int a=5,b=15; jLabel3.setText(String.valueOf("("+a+" > "+a+")"+" AND "+"("+b+" < "+a+")")); jLabel6.setText("Falso AND Falso"); jLabel4.setText("Falso"); // TODO add your handling code here: } /** * @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(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (InstantiationException ex) { java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } catch (IllegalAccessException ex) { java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
  • 8. } catch (javax.swing.UnsupportedLookAndFeelException ex) { java.util.logging.Logger.getLogger(Operador_AND_ejercicio_a.class.getName()).log(java.util.logging.Level.SEVERE, null, ex); } //</editor-fold> //</editor-fold> /* Create and display the form */ java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new Operador_AND_ejercicio_a().setVisible(true); } }); } // Variables declaration - do not modify private javax.swing.JButton jButton1; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JLabel jLabel5; private javax.swing.JLabel jLabel6; // End of variables declaration }
  • 9. Deber sentencias de control Realizar un login con nombre y usuario, dentro de este debe haber un menú • Diseñar y Generar los cinco formularios • Crear las operaciones package javaapplication2; import javax.swing.JOptionPane; public class NewJFrame extends javax.swing.JFrame { public NewJFrame() { initComponents(); } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() {
  • 10. jLabel1 = new javax.swing.JLabel(); jLabel2 = new javax.swing.JLabel(); entrar = new javax.swing.JButton(); jTextField1 = new javax.swing.JTextField(); jpassClave = new javax.swing.JTextField(); jLabel3 = new javax.swing.JLabel(); jLabel4 = new javax.swing.JLabel(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); jLabel1.setText("usuario"); jLabel2.setText("contraseña"); entrar.setText("entrar"); entrar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { entrarActionPerformed(evt); } }); jLabel3.setFont(new java.awt.Font("Tahoma", 1, 14)); // NOI18N jLabel3.setText("USUARIO"); jLabel4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/fotos/12333.jpg"))); // NOI18N javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(55, 55, 55) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jLabel1)
  • 11. .addComponent(jLabel2)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jpassClave, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(103, 103, 103)) .addGroup(layout.createSequentialGroup() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(161, 161, 161) .addComponent(jLabel3)) .addGroup(layout.createSequentialGroup() .addGap(101, 101, 101) .addComponent(jLabel4)) .addGroup(layout.createSequentialGroup() .addGap(139, 139, 139) .addComponent(entrar))) .addContainerGap(124, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(6, 6, 6) .addComponent(jLabel4) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel1) .addComponent(jTextField1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGap(18, 18, 18) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE) .addComponent(jLabel2)
  • 12. .addComponent(jpassClave, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(entrar) .addContainerGap(130, Short.MAX_VALUE)) ); pack(); }// </editor-fold> private void entrarActionPerformed(java.awt.event.ActionEvent evt) { String usuario ="marlon", clave = "12345"; if (jTextField1.getText().equals(usuario) && jpassClave.getText().equals(clave)){ this.dispose(); JOptionPane.showMessageDialog(null, "Bienvenidon" + "Has ingresado satisfactoriamente al sistema", "Mensaje de bienvenida", JOptionPane.INFORMATION_MESSAGE); menu abrir=new menu(); abrir.setVisible(true); }else { JOptionPane.showMessageDialog(null, "Acceso denegado:n" + "Por favor ingrese un usuario y/o contraseña correctos", "Acceso denegado", JOptionPane.ERROR_MESSAGE); } // TODO add your handling code here: } public static void main(String args[]) { java.awt.EventQueue.invokeLater(new Runnable() { public void run() { new NewJFrame().setVisible(true); } }); }
  • 13. // Variables declaration - do not modify private javax.swing.JButton entrar; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; private javax.swing.JLabel jLabel4; private javax.swing.JTextField jTextField1; private javax.swing.JTextField jpassClave; // End of variables declaration } private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { // TODO add your handling code here: double n1,r; n1=Double.parseDouble(jTextField1.getText());
  • 14. r=n1%2; if(r==0) jLabel2.setText("EL NUMERO "+n1+" ES: PAR"); else jLabel2.setText("EL NUMERO "+n1+" ES: IMPAR"); private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int a,b=1,c=0, resultado; int num1=4; int num2=2; int num3=3; int num4=10; a=num1-num2; for (int i=1; i<=3; i++) { b=b*a; c=b*num1; } resultado= c+num4; jTextField1.setText(String.valueOf(resultado)); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { float d,a,b=1, c=0, resultado;
  • 15. float num1=4; int num2=2; int num3=3; int num4=10; float num5=6; d= num5/num1; a=d-num2; for (int i=1; i<=3; i++) { b=b*a; c=b*num1; } resultado= c+num4; jTextField2.setText(String.valueOf(resultado)); } private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) { double d,b,e,r, c=1, resultado; double num2=3; double a, num3=2 ; int num1=7; int num4=1; d= num2/num3; a=d+num4; c=Math.pow(num3, a); b=Math.pow(num2, c); e=num1%num2; resultado=b+e; /*jTextField3.setText(String.valueOf(resultado));*/ jTextField3.setText(""+resultado);
  • 16. ARREGLOS – VALIDACIÓN DE CÉDULA Realizar una consulta sobre la validación de la cédula realizar el programa en java con formularios con menú private void jLabel5MouseClicked(java.awt.event.MouseEvent evt) { // TODO add your handling code here: String cedu=jTextField1.getText(); String [] division=cedu.split(""); int dg1,dg2,dg3,dg4,dg5,dg6,dg7,dg8,dg9; int op1,op2,op3,op4,op5,op6,op7,op8,op9; int suma=0, res=0, dgvericador;
  • 17. if (cedu.length()==10){ dg1=Integer.parseInt(division[division.length-10]); dg2=Integer.parseInt(division[division.length-9]); dg3=Integer.parseInt(division[division.length-8]); dg4=Integer.parseInt(division[division.length-7]); dg5=Integer.parseInt(division[division.length-6]); dg6=Integer.parseInt(division[division.length-5]); dg7=Integer.parseInt(division[division.length-4]); dg8=Integer.parseInt(division[division.length-3]); dg9=Integer.parseInt(division[division.length-2]); dgvericador=Integer.parseInt(division[division.length-1]); jLabel2.setText("Cedula Ingresada "+dg1+" "+dg2+" "+dg3+" "+dg4+" "+dg5+" "+dg6+" "+dg7+" "+dg8+" "+dg9+" "+dgvericador); op1=dg1*2; if (op1>=10){ op1 =op1-9; } op2=dg2*1; op3=dg3*2; if (op3>=10){ op3 = op3- 9; } op4=dg4*1; op5=dg5*2; if (op5>=10){ op5=op5- 9; } op6=dg6*1;
  • 18. op7=dg7*2; if (op7>=10){ op7=op7- 9; } op8=dg8*1; op9=dg9*2; if (op9>=10){ op9=op9-9; } suma=op1+op2+op3+op4+op5+op6+op7+op8+op9; res=suma % 10; if (res==dgvericador){ JOptionPane.showMessageDialog(null, "Cedula Correcta"); jTextField1.setText(null); } else { JOptionPane.showMessageDialog(null, "Cedula Incorrecta"); jTextField1.setText(null); } } else{ JOptionPane.showMessageDialog(null, "Cedula Incompleta");} }
  • 19. private void jTextField1KeyTyped(java.awt.event.KeyEvent evt) { int maximodeletras=10; if(jTextField1.getText().length()>=maximodeletras){ evt.consume(); JOptionPane.showMessageDialog(rootPane, "Solo 10 Digitos"); } JUEGO DE CARTAS private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) { int ne=0,i; if (jCheckBox1.isSelected()) ne=ne+16; if (jCheckBox2.isSelected()) ne=ne+32; if (jCheckBox3.isSelected()) ne=ne+8; if (jCheckBox4.isSelected()) ne=ne+1; if (jCheckBox5.isSelected())
  • 20. ne=ne+2; if (jCheckBox6.isSelected()) ne=ne+4; jTextField1.setText(""+ne); } private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) { System.exit(0); JUEGO DE MEMORIA package gui; import auxiliar.LogicaJuego; import java.awt.BorderLayout; import javax.swing.ImageIcon; import javax.swing.JButton; import javax.swing.JOptionPane; import javax.swing.plaf.OptionPaneUI;
  • 21. /** * * @author Dark */ public class PlayGame extends javax.swing.JFrame { private VFondo fondo; private LogicaJuego log = new LogicaJuego(); private boolean caraUp = false; private ImageIcon im1; private ImageIcon im2; private JButton[] pbtn = new JButton[2]; private boolean primerc = false; private int puntaje = 0; public PlayGame() { initComponents(); fondo = new VFondo(getWidth(), getHeight()); add(fondo, BorderLayout.CENTER); setCards(); } private void setCards() { int[] numbers = log.getCardNumbers(); /* reemplazar el uso de "../imagenes/..." por "/imagenes/..." */ btnC1.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[0] + ".jpg"))); btnC2.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[1] + ".jpg")));
  • 22. btnC3.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[2] + ".jpg"))); btnC4.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[3] + ".jpg"))); btnC5.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[4] + ".jpg"))); btnC6.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[5] + ".jpg"))); btnC7.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[6] + ".jpg"))); btnC8.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[7] + ".jpg"))); btnC9.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[8] + ".jpg"))); btnC10.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[9] + ".jpg"))); btnC11.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[10] + ".jpg"))); btnC12.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[11] + ".jpg"))); btnC13.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[12] + ".jpg"))); btnC14.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[13] + ".jpg"))); btnC15.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[14] + ".jpg"))); btnC16.setDisabledIcon(new ImageIcon(getClass().getResource("/imagenes/c" + numbers[15] + ".jpg"))); } private void btnEnabled(JButton btn) { if (!caraUp) { btn.setEnabled(false); im1 = (ImageIcon) btn.getDisabledIcon(); pbtn[0] = btn; caraUp = true;
  • 23. primerc = false; } else { btn.setEnabled(false); im2 = (ImageIcon) btn.getDisabledIcon(); pbtn[1] = btn; primerc = true; puntaje += 20; pregwin(); } } private void compare() { if (caraUp && primerc) { if (im1.getDescription().compareTo(im2.getDescription()) != 0) { pbtn[0].setEnabled(true); pbtn[1].setEnabled(true); if (puntaje > 10) { puntaje -= 10; } } caraUp = false; } } private void reiniciar() { btnC1.setEnabled(true); btnC2.setEnabled(true); btnC3.setEnabled(true); btnC4.setEnabled(true);
  • 24. btnC5.setEnabled(true); btnC6.setEnabled(true); btnC7.setEnabled(true); btnC8.setEnabled(true); btnC9.setEnabled(true); btnC10.setEnabled(true); btnC11.setEnabled(true); btnC12.setEnabled(true); btnC13.setEnabled(true); btnC14.setEnabled(true); btnC15.setEnabled(true); btnC16.setEnabled(true); primerc = false; caraUp = false; puntaje = 0; } private void pregwin() { if (!btnC1.isEnabled() && !btnC2.isEnabled() && !btnC3.isEnabled() && !btnC4.isEnabled() && !btnC5.isEnabled() && !btnC6.isEnabled() && !btnC7.isEnabled() && !btnC8.isEnabled() && !btnC9.isEnabled() && !btnC10.isEnabled() && !btnC11.isEnabled() && !btnC12.isEnabled() && !btnC13.isEnabled() && !btnC14.isEnabled() && !btnC15.isEnabled() && !btnC16.isEnabled()) { JOptionPane.showMessageDialog(this, "FELICIDADESn Usted ha ganado. Su puntaje es: n" + puntaje, "Puntos!!", JOptionPane.INFORMATION_MESSAGE); } } @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() {
  • 25. jLabel1 = new javax.swing.JLabel(); jPanel1 = new javax.swing.JPanel(); btnC1 = new javax.swing.JButton(); btnC2 = new javax.swing.JButton(); btnC3 = new javax.swing.JButton(); btnC4 = new javax.swing.JButton(); btnC8 = new javax.swing.JButton(); btnC7 = new javax.swing.JButton(); btnC6 = new javax.swing.JButton(); btnC5 = new javax.swing.JButton(); btnC12 = new javax.swing.JButton(); btnC11 = new javax.swing.JButton(); btnC10 = new javax.swing.JButton(); btnC9 = new javax.swing.JButton(); btnC16 = new javax.swing.JButton(); btnC15 = new javax.swing.JButton(); btnC14 = new javax.swing.JButton(); btnC13 = new javax.swing.JButton(); btnReiniciar = new javax.swing.JButton(); jButton1 = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); setTitle("Juego Dos Caras"); jLabel1.setFont(new java.awt.Font("Tempus Sans ITC", 2, 18)); // NOI18N jLabel1.setForeground(new java.awt.Color(255, 51, 51)); jLabel1.setText("JUEGO MEMORIA"); jPanel1.setBackground(new java.awt.Color(102, 153, 255));
  • 26. jPanel1.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0))); btnC1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC1.setBorder(null); btnC1.setBorderPainted(false); btnC1.setContentAreaFilled(false); btnC1.setFocusable(false); btnC1.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC1.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC1MouseExited(evt); } }); btnC1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC1ActionPerformed(evt); } }); btnC2.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC2.setBorder(null); btnC2.setBorderPainted(false); btnC2.setContentAreaFilled(false); btnC2.setFocusable(false); btnC2.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC2.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC2MouseExited(evt);
  • 27. } }); btnC2.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC2ActionPerformed(evt); } }); btnC3.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC3.setBorder(null); btnC3.setBorderPainted(false); btnC3.setContentAreaFilled(false); btnC3.setFocusable(false); btnC3.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC3.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC3MouseExited(evt); } }); btnC3.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC3ActionPerformed(evt); } }); btnC4.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC4.setBorder(null); btnC4.setBorderPainted(false); btnC4.setContentAreaFilled(false);
  • 28. btnC4.setFocusable(false); btnC4.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC4.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC4MouseExited(evt); } }); btnC4.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC4ActionPerformed(evt); } }); btnC8.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC8.setBorder(null); btnC8.setBorderPainted(false); btnC8.setContentAreaFilled(false); btnC8.setFocusable(false); btnC8.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC8.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC8MouseExited(evt); } }); btnC8.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC8ActionPerformed(evt); } });
  • 29. btnC7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC7.setBorder(null); btnC7.setBorderPainted(false); btnC7.setContentAreaFilled(false); btnC7.setFocusable(false); btnC7.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC7.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC7MouseExited(evt); } }); btnC7.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC7ActionPerformed(evt); } }); btnC6.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC6.setBorder(null); btnC6.setBorderPainted(false); btnC6.setContentAreaFilled(false); btnC6.setFocusable(false); btnC6.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC6.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC6MouseExited(evt); } });
  • 30. btnC6.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC6ActionPerformed(evt); } }); btnC5.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC5.setBorder(null); btnC5.setBorderPainted(false); btnC5.setContentAreaFilled(false); btnC5.setFocusable(false); btnC5.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC5.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC5MouseExited(evt); } }); btnC5.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC5ActionPerformed(evt); } }); btnC12.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC12.setBorder(null); btnC12.setBorderPainted(false); btnC12.setContentAreaFilled(false); btnC12.setFocusable(false); btnC12.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N
  • 31. btnC12.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC12MouseExited(evt); } }); btnC12.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC12ActionPerformed(evt); } }); btnC11.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC11.setBorder(null); btnC11.setBorderPainted(false); btnC11.setContentAreaFilled(false); btnC11.setFocusable(false); btnC11.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC11.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC11MouseExited(evt); } }); btnC11.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC11ActionPerformed(evt); } }); btnC10.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N
  • 32. btnC10.setBorder(null); btnC10.setBorderPainted(false); btnC10.setContentAreaFilled(false); btnC10.setFocusable(false); btnC10.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC10.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC10MouseExited(evt); } }); btnC10.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC10ActionPerformed(evt); } }); btnC9.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC9.setBorder(null); btnC9.setBorderPainted(false); btnC9.setContentAreaFilled(false); btnC9.setFocusable(false); btnC9.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC9.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC9MouseExited(evt); } }); btnC9.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) {
  • 33. btnC9ActionPerformed(evt); } }); btnC16.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC16.setBorder(null); btnC16.setBorderPainted(false); btnC16.setContentAreaFilled(false); btnC16.setFocusable(false); btnC16.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC16.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC16MouseExited(evt); } }); btnC16.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC16ActionPerformed(evt); } }); btnC15.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC15.setBorder(null); btnC15.setBorderPainted(false); btnC15.setContentAreaFilled(false); btnC15.setFocusable(false); btnC15.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC15.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) {
  • 34. btnC15MouseExited(evt); } }); btnC15.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC15ActionPerformed(evt); } }); btnC14.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC14.setBorder(null); btnC14.setBorderPainted(false); btnC14.setContentAreaFilled(false); btnC14.setFocusable(false); btnC14.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC14.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC14MouseExited(evt); } }); btnC14.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC14ActionPerformed(evt); } }); btnC13.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/c0.jpg"))); // NOI18N btnC13.setBorder(null); btnC13.setBorderPainted(false);
  • 35. btnC13.setContentAreaFilled(false); btnC13.setFocusable(false); btnC13.setRolloverIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/cr.jpg"))); // NOI18N btnC13.addMouseListener(new java.awt.event.MouseAdapter() { public void mouseExited(java.awt.event.MouseEvent evt) { btnC13MouseExited(evt); } }); btnC13.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnC13ActionPerformed(evt); } }); javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1); jPanel1.setLayout(jPanel1Layout); jPanel1Layout.setHorizontalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE ADING) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(btnC1) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC3)
  • 36. .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC4)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(btnC5) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC6) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC7) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC8)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(btnC9) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC10) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC11) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC12)) .addGroup(jPanel1Layout.createSequentialGroup() .addComponent(btnC13) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC14) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(btnC15) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  • 37. .addComponent(btnC16))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); jPanel1Layout.setVerticalGroup( jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(jPanel1Layout.createSequentialGroup() .addContainerGap() .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE ADING) .addComponent(btnC2) .addComponent(btnC1) .addComponent(btnC3) .addComponent(btnC4)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE ADING) .addComponent(btnC6) .addComponent(btnC5) .addComponent(btnC7) .addComponent(btnC8)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE ADING) .addComponent(btnC9) .addComponent(btnC10) .addComponent(btnC11) .addComponent(btnC12)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  • 38. .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LE ADING) .addComponent(btnC13) .addComponent(btnC14) .addComponent(btnC15) .addComponent(btnC16)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); btnReiniciar.setBackground(new java.awt.Color(153, 255, 51)); btnReiniciar.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N btnReiniciar.setText("VOLVER A INTENTARLO"); btnReiniciar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { btnReiniciarActionPerformed(evt); } }); jButton1.setBackground(new java.awt.Color(153, 255, 51)); jButton1.setFont(new java.awt.Font("Times New Roman", 3, 18)); // NOI18N jButton1.setText("SALIR"); jButton1.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { jButton1ActionPerformed(evt); } }); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup(
  • 39. layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(264, 264, 264) .addComponent(jLabel1)) .addGroup(layout.createSequentialGroup() .addGap(120, 120, 120) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(layout.createSequentialGroup() .addGap(130, 130, 130) .addComponent(btnReiniciar) .addGap(49, 49, 49) .addComponent(jButton1)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addGap(12, 12, 12) .addComponent(jLabel1) .addGap(6, 6, 6) .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(4, 4, 4) .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addComponent(btnReiniciar) .addComponent(jButton1))) ); setSize(new java.awt.Dimension(630, 520)); setLocationRelativeTo(null);
  • 40. }// </editor-fold> private void btnC1ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC1); } private void btnC2ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC2); } private void btnC3ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC3); } private void btnC4ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC4); } private void btnC5ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC5); } private void btnC6ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC6); } private void btnC7ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC7); } private void btnC8ActionPerformed(java.awt.event.ActionEvent evt) {
  • 41. btnEnabled(btnC8); } private void btnC9ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC9); } private void btnC10ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC10); } private void btnC11ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC11); } private void btnC12ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC12); } private void btnC13ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC13); } private void btnC14ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC14); } private void btnC15ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC15); }
  • 42. private void btnC16ActionPerformed(java.awt.event.ActionEvent evt) { btnEnabled(btnC16); } private void btnC1MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC2MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC3MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC4MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC5MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC6MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here:
  • 43. compare(); } private void btnC7MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC8MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC9MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC10MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC11MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); } private void btnC12MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare();
  • 44. } private void btnC13MouseExited(java.awt.event.MouseEvent evt) { // TODO add your handling code here: compare(); CLIENTE – SERVIDOR