SlideShare une entreprise Scribd logo
1  sur  15
/**
*
* @author Rigoberto Vega Linares
*/
public class Encuesta extends javax.swing.JFrame {
public Encuesta() {
initComponents();
}
//Creacion De Los Contadores//
private int
Contador_Menor_Casado=0,Opinion_Menor_Casado=0,Contador_Menor_Soltero=0,Opinion_Me
nor_Soltero=0,Contador_Medio_Casado=0;
private int
Opinion_Medio_Casado=0,Contador_Medio_Soltero=0,Opinion_Medio_Soltero=0,Contador_May
or_Casado=0,Opinion_Mayor_Casado=0;
private int Contador_Mayor_Soltero=0,Opinion_Mayor_Soltero=0;
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated Code">
private void initComponents() {
//Inicializacion De Cada Uno De Los Componentes Del Interfaz grafico.//
Panel_Opinion = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
Mensaje_Edad = new javax.swing.JLabel();
Bombox_Edad = new javax.swing.JComboBox();
jLabel3 = new javax.swing.JLabel();
Combo_Estado = new javax.swing.JComboBox();
Label_Opinion = new javax.swing.JLabel();
Opinion = new javax.swing.JComboBox();
Agregar_Opinion = new javax.swing.JButton();
Panel_Resultados = new javax.swing.JPanel();
Label_Opiniones = new javax.swing.JLabel();
Opiniones = new javax.swing.JLabel();
Label_promedio = new javax.swing.JLabel();
Promedio = new javax.swing.JLabel();
Rango_Edad = new javax.swing.JLabel();
Combox_Rango_Edad = new javax.swing.JComboBox();
jLabel2 = new javax.swing.JLabel();
Combox_Estado_Civil = new javax.swing.JComboBox();
Consultar = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
Panel_Opinion.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "AGREGAR
OPINION A ENCUESTA", javax.swing.border.TitledBorder.CENTER,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new
java.awt.Color(0, 153, 153))); // NOI18N
//Creacion De La Pregunta Con El Tipo De Letra/
jLabel1.setBackground(new java.awt.Color(0, 0, 0));
jLabel1.setFont(new java.awt.Font("Arial", 1, 14));
jLabel1.setText("¿CUAL ES SU OPINION SOBRE ESTE CURSO? CALIFICAR DE 1 A 10");
//Creacion Del Label Que Pregunta La Edad//
Mensaje_Edad.setFont(new java.awt.Font("Arial", 1, 12));
Mensaje_Edad.setText("Rango De Edad: ");
//Creacion De Desplegable De Las Edades
Bombox_Edad.setFont(new java.awt.Font("Arial", 1, 14));
Bombox_Edad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0 - 17", "18
- 54", "Mas 55" }));
Bombox_Edad.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Bombox_EdadActionPerformed(evt);
}
});
//Creacion Del Label Que Pregunta estado Civil
jLabel3.setFont(new java.awt.Font("Arial", 1, 12));
jLabel3.setText("Estado Civil: ");
//Creacion De Desplegable Del Estado Civil
Combo_Estado.setFont(new java.awt.Font("Arial", 1, 12));
Combo_Estado.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
"Casado(a)", "Soltero(a)" }));
//Creacion Del Label Para La Calificacion
Label_Opinion.setFont(new java.awt.Font("Arial", 1, 12));
Label_Opinion.setText("Opinion: ");
//Creacion Del Despegable De Las Opiniones Y Calificacion De La Pregunta
Opinion.setFont(new java.awt.Font("Arial", 1, 12));
Opinion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3",
"4", "5", "6", "7", "8", "9", "10" }));
//Creacion Del Boton Para Agregar La Opinion
Agregar_Opinion.setFont(new java.awt.Font("Arial", 1, 14));
Agregar_Opinion.setText("Agregar Opinion");
Agregar_Opinion.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
Agregar_OpinionActionPerformed(evt);
}
});
//Creacion Del Panel Prncipal Llamado El De Opinion
javax.swing.GroupLayout Panel_OpinionLayout = new
javax.swing.GroupLayout(Panel_Opinion);
Panel_Opinion.setLayout(Panel_OpinionLayout);
//Agregacion De Cada Uno DeLos Componentes Del Pane De Opinion
Panel_OpinionLayout.setHorizontalGroup(
Panel_OpinionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(Panel_OpinionLayout.createSequentialGroup()
.addGroup(Panel_OpinionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN
G)
.addGroup(Panel_OpinionLayout.createSequentialGroup()
.addGap(20, 20, 20)
.addComponent(jLabel1))
.addGroup(Panel_OpinionLayout.createSequentialGroup()
.addContainerGap()
.addComponent(Mensaje_Edad, javax.swing.GroupLayout.PREFERRED_SIZE, 107,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Bombox_Edad, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel3)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Combo_Estado, javax.swing.GroupLayout.PREFERRED_SIZE, 85,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(47, 47, 47)
.addComponent(Label_Opinion)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Opinion, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(Panel_OpinionLayout.createSequentialGroup()
.addGap(181, 181, 181)
.addComponent(Agregar_Opinion)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
Panel_OpinionLayout.setVerticalGroup(
Panel_OpinionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(Panel_OpinionLayout.createSequentialGroup()
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 47,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(Panel_OpinionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI
NE)
.addComponent(Mensaje_Edad, javax.swing.GroupLayout.PREFERRED_SIZE, 27,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Bombox_Edad, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(Combo_Estado, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Label_Opinion)
.addComponent(Opinion, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Agregar_Opinion)
.addContainerGap())
);
//Creacion Del Panel De Resultados
Panel_Resultados.setBorder(javax.swing.BorderFactory.createTitledBorder(null,
"RESULTADOS ENCUENTA", javax.swing.border.TitledBorder.CENTER,
javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new
java.awt.Color(0, 153, 153))); // NOI18N
//creacion Del Label Del Numero De Opiniones
Label_Opiniones.setFont(new java.awt.Font("Arial", 1, 14)); //
Label_Opiniones.setText("Numero De Opiniones: ");
Opiniones.setFont(new java.awt.Font("Arial", 1, 14)); //
//creacion Del Label Para el Promedio
Label_promedio.setFont(new java.awt.Font("Arial", 1, 14)); //
Label_promedio.setText("Promedio Total Opiniones: ");
Promedio.setFont(new java.awt.Font("Arial", 1, 14)); //
//creacion Del Label Para Saber La Calificacion Del Rango De Edad
Rango_Edad.setFont(new java.awt.Font("Arial", 1, 12)); //
Rango_Edad.setText("Rando De Edad: ");
Combox_Rango_Edad.setFont(new java.awt.Font("Arial", 1, 12));
Combox_Rango_Edad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0 -
17", "18 - 54", "Mas 55" }));
jLabel2.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
jLabel2.setText("Estado Civil: ");
//creacion Del Label Para Saber La Calificacion Del Estado Civil
Combox_Estado_Civil.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
Combox_Estado_Civil.setModel(new javax.swing.DefaultComboBoxModel(new String[] {
"Casado(a)", "Soltero(a)" }));
//creacion Del boton Para consultar
Consultar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N
Consultar.setText("Consultar");
Consultar.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
ConsultarActionPerformed(evt);
}
});
//Agregacion De Cada Uno De Los Componentes del Label De Resultados
javax.swing.GroupLayout Panel_ResultadosLayout = new
javax.swing.GroupLayout(Panel_Resultados);
Panel_Resultados.setLayout(Panel_ResultadosLayout);
Panel_ResultadosLayout.setHorizontalGroup(
Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(Panel_ResultadosLayout.createSequentialGroup()
.addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addGroup(Panel_ResultadosLayout.createSequentialGroup()
.addGap(118, 118, 118)
.addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(Label_promedio)
.addComponent(Label_Opiniones))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(Opiniones)
.addComponent(Promedio)))
.addGroup(Panel_ResultadosLayout.createSequentialGroup()
.addContainerGap()
.addComponent(Rango_Edad)
.addGap(16, 16, 16)
.addComponent(Combox_Rango_Edad, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(18, 18, 18)
.addComponent(jLabel2)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Combox_Estado_Civil, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(37, 37, 37)
.addComponent(Consultar)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
Panel_ResultadosLayout.setVerticalGroup(
Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(Panel_ResultadosLayout.createSequentialGroup()
.addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BAS
ELINE)
.addComponent(Label_Opiniones)
.addComponent(Opiniones))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BAS
ELINE)
.addComponent(Label_promedio)
.addComponent(Promedio))
.addGap(18, 18, 18)
.addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BAS
ELINE)
.addComponent(Rango_Edad)
.addComponent(Combox_Rango_Edad, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel2)
.addComponent(Combox_Estado_Civil, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(Consultar)))
);
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING,
false)
.addComponent(Panel_Opinion, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(Panel_Resultados, javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addComponent(Panel_Opinion, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(Panel_Resultados, javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
pack();
}
private void Agregar_OpinionActionPerformed(java.awt.event.ActionEvent evt) {
//Este Swicth Agrega A Los COntadores Las Acciones
switch (Bombox_Edad.getSelectedIndex()){
case 0:
if (Combo_Estado.getSelectedIndex()==0){
Contador_Menor_Casado++;
Opinion_Menor_Casado+=Opinion.getSelectedIndex();
break;
}else{
Contador_Menor_Soltero++;
Opinion_Menor_Soltero+=Opinion.getSelectedIndex();
break;
}
case 1:
if (Combo_Estado.getSelectedIndex()==0){
Contador_Medio_Casado++;
Opinion_Medio_Casado+=Opinion.getSelectedIndex();
break;
}else{
Contador_Medio_Soltero++;
Opinion_Medio_Soltero+=Opinion.getSelectedIndex();
break;
}
case 2:
if (Combo_Estado.getSelectedIndex()==0){
Contador_Mayor_Casado++;
Opinion_Mayor_Casado+=Opinion.getSelectedIndex();
break;
}else{
Contador_Mayor_Soltero++;
Opinion_Mayor_Soltero+=Opinion.getSelectedIndex();
break;
}
}
}
private void ConsultarActionPerformed(java.awt.event.ActionEvent evt) {
int mostrar;
//Aqui se muestra de acuerdo con la cunsulta seleccionada y muestra en labels el dato
switch (Combox_Rango_Edad.getSelectedIndex()){
case 0:
if (Combox_Estado_Civil.getSelectedIndex()==0){
Opiniones.setText(Integer.toString(Contador_Menor_Casado));
mostrar=Opinion_Menor_Casado/Contador_Menor_Casado;
Promedio.setText(Integer.toString(mostrar));
break;
}else{
Opiniones.setText(Integer.toString(Contador_Menor_Soltero));
mostrar=Opinion_Menor_Soltero/Contador_Menor_Soltero;
Promedio.setText(Integer.toString(mostrar));
break;
}
case 1:
if (Combox_Estado_Civil.getSelectedIndex()==0){
Opiniones.setText(Integer.toString(Contador_Medio_Casado));
mostrar=Opinion_Medio_Casado/Contador_Medio_Casado;
Promedio.setText(Integer.toString(mostrar));
break;
}else{
Opiniones.setText(Integer.toString(Contador_Medio_Soltero));
mostrar=Opinion_Medio_Soltero/Contador_Medio_Soltero;
Promedio.setText(Integer.toString(mostrar));
break;
}
case 2:
if (Combox_Estado_Civil.getSelectedIndex()==0){
Opiniones.setText(Integer.toString(Contador_Mayor_Casado));
mostrar=Opinion_Mayor_Casado/Contador_Mayor_Casado;
Promedio.setText(Integer.toString(mostrar));
break;
}else{
Opiniones.setText(Integer.toString(Contador_Mayor_Soltero));
mostrar=Opinion_Mayor_Soltero/Contador_Mayor_Soltero;
Promedio.setText(Integer.toString(mostrar));
break;
}
}
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new Encuesta().setVisible(true);
}
});
}
// Declaracion De las Variables
private javax.swing.JButton Agregar_Opinion;
private javax.swing.JComboBox Bombox_Edad;
private javax.swing.JComboBox Combo_Estado;
private javax.swing.JComboBox Combox_Estado_Civil;
private javax.swing.JComboBox Combox_Rango_Edad;
private javax.swing.JButton Consultar;
private javax.swing.JLabel Label_Opinion;
private javax.swing.JLabel Label_Opiniones;
private javax.swing.JLabel Label_promedio;
private javax.swing.JLabel Mensaje_Edad;
private javax.swing.JComboBox Opinion;
private javax.swing.JLabel Opiniones;
private javax.swing.JPanel Panel_Opinion;
private javax.swing.JPanel Panel_Resultados;
private javax.swing.JLabel Promedio;
private javax.swing.JLabel Rango_Edad;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
}

Contenu connexe

Tendances

Code to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCode to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCaleb Jenkins
 
Effective Android Data Binding
Effective Android Data BindingEffective Android Data Binding
Effective Android Data BindingEric Maxwell
 
Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8Wilson Su
 
Обзор фреймворка Twisted
Обзор фреймворка TwistedОбзор фреймворка Twisted
Обзор фреймворка TwistedMaxim Kulsha
 
Practical JavaScript Programming - Session 7/8
Practical JavaScript Programming - Session 7/8Practical JavaScript Programming - Session 7/8
Practical JavaScript Programming - Session 7/8Wilson Su
 
More android code puzzles
More android code puzzlesMore android code puzzles
More android code puzzlesDanny Preussler
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesMichael Galpin
 
AIWolf programming guide
AIWolf programming guideAIWolf programming guide
AIWolf programming guideHirotaka Osawa
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your appsJuan C Catalan
 

Tendances (10)

Code to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern ApplicationsCode to DI For - Dependency Injection for Modern Applications
Code to DI For - Dependency Injection for Modern Applications
 
Effective Android Data Binding
Effective Android Data BindingEffective Android Data Binding
Effective Android Data Binding
 
Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8Practical JavaScript Programming - Session 8/8
Practical JavaScript Programming - Session 8/8
 
Обзор фреймворка Twisted
Обзор фреймворка TwistedОбзор фреймворка Twisted
Обзор фреймворка Twisted
 
Practical JavaScript Programming - Session 7/8
Practical JavaScript Programming - Session 7/8Practical JavaScript Programming - Session 7/8
Practical JavaScript Programming - Session 7/8
 
More android code puzzles
More android code puzzlesMore android code puzzles
More android code puzzles
 
Java awt
Java awtJava awt
Java awt
 
Design Patterns for Tablets and Smartphones
Design Patterns for Tablets and SmartphonesDesign Patterns for Tablets and Smartphones
Design Patterns for Tablets and Smartphones
 
AIWolf programming guide
AIWolf programming guideAIWolf programming guide
AIWolf programming guide
 
Adopting 3D Touch in your apps
Adopting 3D Touch in your appsAdopting 3D Touch in your apps
Adopting 3D Touch in your apps
 

En vedette (8)

Πολυμεσα Αλεξια Β1
Πολυμεσα Αλεξια Β1Πολυμεσα Αλεξια Β1
Πολυμεσα Αλεξια Β1
 
Taller 5
Taller 5Taller 5
Taller 5
 
Spreadly - The Social Sharing Ad-Network
Spreadly - The Social Sharing Ad-NetworkSpreadly - The Social Sharing Ad-Network
Spreadly - The Social Sharing Ad-Network
 
Prima presentation
Prima presentationPrima presentation
Prima presentation
 
De Academie
De AcademieDe Academie
De Academie
 
Pitch at EVM in Berlin
Pitch at EVM in BerlinPitch at EVM in Berlin
Pitch at EVM in Berlin
 
Droger på internet 110222
Droger på internet 110222Droger på internet 110222
Droger på internet 110222
 
Taller 4
Taller 4Taller 4
Taller 4
 

Similaire à Encuesta

IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbsesiddharthjha34
 
Settings
SettingsSettings
Settingsyito24
 
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Frédéric Harper
 
Don't Make Android Bad... Again
Don't Make Android Bad... AgainDon't Make Android Bad... Again
Don't Make Android Bad... AgainPedro Vicente
 
Droidjam 2019 flutter isolates pdf
Droidjam 2019 flutter isolates pdfDroidjam 2019 flutter isolates pdf
Droidjam 2019 flutter isolates pdfAnvith Bhat
 
Othello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfOthello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfarccreation001
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotationjavatwo2011
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...solit
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMohammad Shaker
 
Secret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutSecret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutDror Helper
 
Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Javacmkandemir
 

Similaire à Encuesta (20)

Maze
MazeMaze
Maze
 
IP project for class 12 cbse
IP project for class 12 cbseIP project for class 12 cbse
IP project for class 12 cbse
 
SWTBot Tutorial
SWTBot TutorialSWTBot Tutorial
SWTBot Tutorial
 
Settings
SettingsSettings
Settings
 
Bot builder v4 HOL
Bot builder v4 HOLBot builder v4 HOL
Bot builder v4 HOL
 
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
Windows 8 Pure Imagination - 2012-11-25 - Extending Your Game with Windows 8 ...
 
New text document
New text documentNew text document
New text document
 
Don't Make Android Bad... Again
Don't Make Android Bad... AgainDon't Make Android Bad... Again
Don't Make Android Bad... Again
 
Droidjam 2019 flutter isolates pdf
Droidjam 2019 flutter isolates pdfDroidjam 2019 flutter isolates pdf
Droidjam 2019 flutter isolates pdf
 
Android Basic Components
Android Basic ComponentsAndroid Basic Components
Android Basic Components
 
Othello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdfOthello.javapackage othello;import core.Game; import userInter.pdf
Othello.javapackage othello;import core.Game; import userInter.pdf
 
Android For All The Things
Android For All The ThingsAndroid For All The Things
Android For All The Things
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
Solit 2013, Автоматизация тестирования сложных систем: mixed mode automated t...
 
package org dev
package org devpackage org dev
package org dev
 
Package org dev
Package org devPackage org dev
Package org dev
 
Mobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhoneMobile Software Engineering Crash Course - C06 WindowsPhone
Mobile Software Engineering Crash Course - C06 WindowsPhone
 
Secret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you aboutSecret unit testing tools no one ever told you about
Secret unit testing tools no one ever told you about
 
Matching Game In Java
Matching Game In JavaMatching Game In Java
Matching Game In Java
 
JavaScript Refactoring
JavaScript RefactoringJavaScript Refactoring
JavaScript Refactoring
 

Plus de Řỉgö VẻGầ

Plus de Řỉgö VẻGầ (20)

Configuración servidores DCHP, DNS y HTTP - Cisco Packet Tracer
Configuración servidores DCHP, DNS y HTTP - Cisco Packet TracerConfiguración servidores DCHP, DNS y HTTP - Cisco Packet Tracer
Configuración servidores DCHP, DNS y HTTP - Cisco Packet Tracer
 
Pratica1
Pratica1Pratica1
Pratica1
 
Laboratorio 4 1 introping
Laboratorio 4 1 intropingLaboratorio 4 1 introping
Laboratorio 4 1 introping
 
Laboratorio 3 mascara de subred
Laboratorio 3 mascara de subredLaboratorio 3 mascara de subred
Laboratorio 3 mascara de subred
 
Taller 6
Taller 6Taller 6
Taller 6
 
Taller parcial
Taller parcialTaller parcial
Taller parcial
 
Taller interfaz 3
Taller interfaz 3Taller interfaz 3
Taller interfaz 3
 
Taller interfaz 2
Taller interfaz 2Taller interfaz 2
Taller interfaz 2
 
Interfaz Grafica En Java
Interfaz Grafica En JavaInterfaz Grafica En Java
Interfaz Grafica En Java
 
Taller de string(java)
Taller de string(java)Taller de string(java)
Taller de string(java)
 
Hechos en clase
Hechos en claseHechos en clase
Hechos en clase
 
Taller1
Taller1Taller1
Taller1
 
Taller Matrices En Java
Taller Matrices En JavaTaller Matrices En Java
Taller Matrices En Java
 
Historia de la computacion, tipos de lenguaje de programacion e historia
Historia de la computacion, tipos de lenguaje de programacion e historiaHistoria de la computacion, tipos de lenguaje de programacion e historia
Historia de la computacion, tipos de lenguaje de programacion e historia
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
 
Leyes
LeyesLeyes
Leyes
 
Como fabricar queso
Como fabricar quesoComo fabricar queso
Como fabricar queso
 
Ventajas y desventajas de las redes sociales
Ventajas y desventajas de las redes socialesVentajas y desventajas de las redes sociales
Ventajas y desventajas de las redes sociales
 
Leyes
LeyesLeyes
Leyes
 

Dernier

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024The Digital Insurer
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FMESafe Software
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Orbitshub
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 

Dernier (20)

AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 

Encuesta

  • 1. /** * * @author Rigoberto Vega Linares */ public class Encuesta extends javax.swing.JFrame { public Encuesta() { initComponents(); } //Creacion De Los Contadores// private int Contador_Menor_Casado=0,Opinion_Menor_Casado=0,Contador_Menor_Soltero=0,Opinion_Me nor_Soltero=0,Contador_Medio_Casado=0; private int Opinion_Medio_Casado=0,Contador_Medio_Soltero=0,Opinion_Medio_Soltero=0,Contador_May or_Casado=0,Opinion_Mayor_Casado=0; private int Contador_Mayor_Soltero=0,Opinion_Mayor_Soltero=0; @SuppressWarnings("unchecked") // <editor-fold defaultstate="collapsed" desc="Generated Code"> private void initComponents() { //Inicializacion De Cada Uno De Los Componentes Del Interfaz grafico.// Panel_Opinion = new javax.swing.JPanel(); jLabel1 = new javax.swing.JLabel(); Mensaje_Edad = new javax.swing.JLabel(); Bombox_Edad = new javax.swing.JComboBox(); jLabel3 = new javax.swing.JLabel(); Combo_Estado = new javax.swing.JComboBox();
  • 2. Label_Opinion = new javax.swing.JLabel(); Opinion = new javax.swing.JComboBox(); Agregar_Opinion = new javax.swing.JButton(); Panel_Resultados = new javax.swing.JPanel(); Label_Opiniones = new javax.swing.JLabel(); Opiniones = new javax.swing.JLabel(); Label_promedio = new javax.swing.JLabel(); Promedio = new javax.swing.JLabel(); Rango_Edad = new javax.swing.JLabel(); Combox_Rango_Edad = new javax.swing.JComboBox(); jLabel2 = new javax.swing.JLabel(); Combox_Estado_Civil = new javax.swing.JComboBox(); Consultar = new javax.swing.JButton(); setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE); Panel_Opinion.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "AGREGAR OPINION A ENCUESTA", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(0, 153, 153))); // NOI18N //Creacion De La Pregunta Con El Tipo De Letra/ jLabel1.setBackground(new java.awt.Color(0, 0, 0)); jLabel1.setFont(new java.awt.Font("Arial", 1, 14)); jLabel1.setText("¿CUAL ES SU OPINION SOBRE ESTE CURSO? CALIFICAR DE 1 A 10"); //Creacion Del Label Que Pregunta La Edad//
  • 3. Mensaje_Edad.setFont(new java.awt.Font("Arial", 1, 12)); Mensaje_Edad.setText("Rango De Edad: "); //Creacion De Desplegable De Las Edades Bombox_Edad.setFont(new java.awt.Font("Arial", 1, 14)); Bombox_Edad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0 - 17", "18 - 54", "Mas 55" })); Bombox_Edad.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Bombox_EdadActionPerformed(evt); } }); //Creacion Del Label Que Pregunta estado Civil jLabel3.setFont(new java.awt.Font("Arial", 1, 12)); jLabel3.setText("Estado Civil: "); //Creacion De Desplegable Del Estado Civil Combo_Estado.setFont(new java.awt.Font("Arial", 1, 12)); Combo_Estado.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Casado(a)", "Soltero(a)" })); //Creacion Del Label Para La Calificacion Label_Opinion.setFont(new java.awt.Font("Arial", 1, 12)); Label_Opinion.setText("Opinion: "); //Creacion Del Despegable De Las Opiniones Y Calificacion De La Pregunta
  • 4. Opinion.setFont(new java.awt.Font("Arial", 1, 12)); Opinion.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10" })); //Creacion Del Boton Para Agregar La Opinion Agregar_Opinion.setFont(new java.awt.Font("Arial", 1, 14)); Agregar_Opinion.setText("Agregar Opinion"); Agregar_Opinion.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { Agregar_OpinionActionPerformed(evt); } }); //Creacion Del Panel Prncipal Llamado El De Opinion javax.swing.GroupLayout Panel_OpinionLayout = new javax.swing.GroupLayout(Panel_Opinion); Panel_Opinion.setLayout(Panel_OpinionLayout); //Agregacion De Cada Uno DeLos Componentes Del Pane De Opinion Panel_OpinionLayout.setHorizontalGroup( Panel_OpinionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Panel_OpinionLayout.createSequentialGroup() .addGroup(Panel_OpinionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADIN G) .addGroup(Panel_OpinionLayout.createSequentialGroup() .addGap(20, 20, 20)
  • 5. .addComponent(jLabel1)) .addGroup(Panel_OpinionLayout.createSequentialGroup() .addContainerGap() .addComponent(Mensaje_Edad, javax.swing.GroupLayout.PREFERRED_SIZE, 107, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Bombox_Edad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel3) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Combo_Estado, javax.swing.GroupLayout.PREFERRED_SIZE, 85, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(47, 47, 47) .addComponent(Label_Opinion) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Opinion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addGroup(Panel_OpinionLayout.createSequentialGroup() .addGap(181, 181, 181) .addComponent(Agregar_Opinion))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); Panel_OpinionLayout.setVerticalGroup( Panel_OpinionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Panel_OpinionLayout.createSequentialGroup()
  • 6. .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 47, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(Panel_OpinionLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELI NE) .addComponent(Mensaje_Edad, javax.swing.GroupLayout.PREFERRED_SIZE, 27, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Bombox_Edad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel3) .addComponent(Combo_Estado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Label_Opinion) .addComponent(Opinion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Agregar_Opinion) .addContainerGap()) ); //Creacion Del Panel De Resultados Panel_Resultados.setBorder(javax.swing.BorderFactory.createTitledBorder(null, "RESULTADOS ENCUENTA", javax.swing.border.TitledBorder.CENTER, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Arial", 1, 14), new java.awt.Color(0, 153, 153))); // NOI18N //creacion Del Label Del Numero De Opiniones Label_Opiniones.setFont(new java.awt.Font("Arial", 1, 14)); // Label_Opiniones.setText("Numero De Opiniones: ");
  • 7. Opiniones.setFont(new java.awt.Font("Arial", 1, 14)); // //creacion Del Label Para el Promedio Label_promedio.setFont(new java.awt.Font("Arial", 1, 14)); // Label_promedio.setText("Promedio Total Opiniones: "); Promedio.setFont(new java.awt.Font("Arial", 1, 14)); // //creacion Del Label Para Saber La Calificacion Del Rango De Edad Rango_Edad.setFont(new java.awt.Font("Arial", 1, 12)); // Rango_Edad.setText("Rando De Edad: "); Combox_Rango_Edad.setFont(new java.awt.Font("Arial", 1, 12)); Combox_Rango_Edad.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "0 - 17", "18 - 54", "Mas 55" })); jLabel2.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N jLabel2.setText("Estado Civil: "); //creacion Del Label Para Saber La Calificacion Del Estado Civil Combox_Estado_Civil.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N Combox_Estado_Civil.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Casado(a)", "Soltero(a)" })); //creacion Del boton Para consultar
  • 8. Consultar.setFont(new java.awt.Font("Arial", 1, 12)); // NOI18N Consultar.setText("Consultar"); Consultar.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(java.awt.event.ActionEvent evt) { ConsultarActionPerformed(evt); } }); //Agregacion De Cada Uno De Los Componentes del Label De Resultados javax.swing.GroupLayout Panel_ResultadosLayout = new javax.swing.GroupLayout(Panel_Resultados); Panel_Resultados.setLayout(Panel_ResultadosLayout); Panel_ResultadosLayout.setHorizontalGroup( Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Panel_ResultadosLayout.createSequentialGroup() .addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA DING) .addGroup(Panel_ResultadosLayout.createSequentialGroup() .addGap(118, 118, 118) .addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA DING) .addComponent(Label_promedio) .addComponent(Label_Opiniones)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA DING)
  • 9. .addComponent(Opiniones) .addComponent(Promedio))) .addGroup(Panel_ResultadosLayout.createSequentialGroup() .addContainerGap() .addComponent(Rango_Edad) .addGap(16, 16, 16) .addComponent(Combox_Rango_Edad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(18, 18, 18) .addComponent(jLabel2) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Combox_Estado_Civil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addGap(37, 37, 37) .addComponent(Consultar))) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); Panel_ResultadosLayout.setVerticalGroup( Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(Panel_ResultadosLayout.createSequentialGroup() .addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BAS ELINE) .addComponent(Label_Opiniones) .addComponent(Opiniones)) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
  • 10. .addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BAS ELINE) .addComponent(Label_promedio) .addComponent(Promedio)) .addGap(18, 18, 18) .addGroup(Panel_ResultadosLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BAS ELINE) .addComponent(Rango_Edad) .addComponent(Combox_Rango_Edad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(jLabel2) .addComponent(Combox_Estado_Civil, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addComponent(Consultar))) ); javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane()); getContentPane().setLayout(layout); layout.setHorizontalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false) .addComponent(Panel_Opinion, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
  • 11. .addComponent(Panel_Resultados, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); layout.setVerticalGroup( layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING) .addGroup(layout.createSequentialGroup() .addContainerGap() .addComponent(Panel_Opinion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED) .addComponent(Panel_Resultados, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE) .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)) ); pack(); } private void Agregar_OpinionActionPerformed(java.awt.event.ActionEvent evt) { //Este Swicth Agrega A Los COntadores Las Acciones switch (Bombox_Edad.getSelectedIndex()){ case 0: if (Combo_Estado.getSelectedIndex()==0){ Contador_Menor_Casado++; Opinion_Menor_Casado+=Opinion.getSelectedIndex(); break;
  • 12. }else{ Contador_Menor_Soltero++; Opinion_Menor_Soltero+=Opinion.getSelectedIndex(); break; } case 1: if (Combo_Estado.getSelectedIndex()==0){ Contador_Medio_Casado++; Opinion_Medio_Casado+=Opinion.getSelectedIndex(); break; }else{ Contador_Medio_Soltero++; Opinion_Medio_Soltero+=Opinion.getSelectedIndex(); break; } case 2: if (Combo_Estado.getSelectedIndex()==0){ Contador_Mayor_Casado++; Opinion_Mayor_Casado+=Opinion.getSelectedIndex(); break; }else{ Contador_Mayor_Soltero++; Opinion_Mayor_Soltero+=Opinion.getSelectedIndex(); break; } }
  • 13. } private void ConsultarActionPerformed(java.awt.event.ActionEvent evt) { int mostrar; //Aqui se muestra de acuerdo con la cunsulta seleccionada y muestra en labels el dato switch (Combox_Rango_Edad.getSelectedIndex()){ case 0: if (Combox_Estado_Civil.getSelectedIndex()==0){ Opiniones.setText(Integer.toString(Contador_Menor_Casado)); mostrar=Opinion_Menor_Casado/Contador_Menor_Casado; Promedio.setText(Integer.toString(mostrar)); break; }else{ Opiniones.setText(Integer.toString(Contador_Menor_Soltero)); mostrar=Opinion_Menor_Soltero/Contador_Menor_Soltero; Promedio.setText(Integer.toString(mostrar)); break; } case 1: if (Combox_Estado_Civil.getSelectedIndex()==0){ Opiniones.setText(Integer.toString(Contador_Medio_Casado)); mostrar=Opinion_Medio_Casado/Contador_Medio_Casado; Promedio.setText(Integer.toString(mostrar)); break; }else{ Opiniones.setText(Integer.toString(Contador_Medio_Soltero));
  • 15. private javax.swing.JButton Agregar_Opinion; private javax.swing.JComboBox Bombox_Edad; private javax.swing.JComboBox Combo_Estado; private javax.swing.JComboBox Combox_Estado_Civil; private javax.swing.JComboBox Combox_Rango_Edad; private javax.swing.JButton Consultar; private javax.swing.JLabel Label_Opinion; private javax.swing.JLabel Label_Opiniones; private javax.swing.JLabel Label_promedio; private javax.swing.JLabel Mensaje_Edad; private javax.swing.JComboBox Opinion; private javax.swing.JLabel Opiniones; private javax.swing.JPanel Panel_Opinion; private javax.swing.JPanel Panel_Resultados; private javax.swing.JLabel Promedio; private javax.swing.JLabel Rango_Edad; private javax.swing.JLabel jLabel1; private javax.swing.JLabel jLabel2; private javax.swing.JLabel jLabel3; }