SlideShare una empresa de Scribd logo
INFORME
ESTUDIANETE: Lenin Quishpe SEMESTRE: Segundo
PARALELO: C PRÁCTICA #21
TEMA:
Desarrollo de nuestra practica veintiuno en ECLIPSE.
OBJETIVO:
-Conocereldesarrollodeunprogramaen“Eclipse”,paraestedesarrollotendremosquecomprender
lo que son los formularios en Windows builder.
RESULTADOS DE APRENDIZAJE
-Comprensión de la aplicación de Eclipse.
-Uso correcto del código que aplicaremos en Eclipse.
-Aprender el uso correcto de los formularios
- Aprender a hacer operaciones básicas en un formulario
ACTIVIDADES:
-Realizar un programa que con los votos de los presidentes
DESARROLLO DE CONTENIDOS
package FormularioPolitica;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
//import jdk.nashorn.internal.runtime.ConsString;
//import dos.primero;//
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JTextPane;
import java.awt.Color;
import javax.swing.DropMode;
public class Politica extends JFrame {
public JPanel contentPane;
public JTextField xd;
public JTextField xdd;
private JTextField xddd;
private JTextField xdddd;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Politica frame = new Politica();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Politica() {
Resultados resivir = new Resultados();
resivir.setVisible(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 859, 581);
contentPane = new JPanel();
contentPane.setBackground(new Color(204, 255, 255));
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
this.setLocationRelativeTo(null);
JLabel lblNewLabel_2 = new JLabel("Elecciones Presidenciales 2021");
lblNewLabel_2.setBounds(226, 10, 391, 47);
lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 22));
contentPane.add(lblNewLabel_2);
JLabel lblNewLabel = new JLabel("Guillermo Lasso");
lblNewLabel.setBounds(122, 83, 173, 31);
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 20));
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("Andru00E9s Arau00FAs");
lblNewLabel_1.setBounds(523, 87, 157, 22);
lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 20));
contentPane.add(lblNewLabel_1);
JLabel lblNewLabel_3 = new JLabel("");
lblNewLabel_3.setBounds(502, 146, 173, 165);
lblNewLabel_3.setIcon(new
ImageIcon("C:UsersBlue.DotaDesktopimages.jfif"));
contentPane.add(lblNewLabel_3);
JLabel lblNewLabel_4 = new JLabel("");
lblNewLabel_4.setBounds(103, 146, 173, 165);
lblNewLabel_4.setIcon(new ImageIcon("C:UsersBlue.DotaDesktoplll.jfif"));
contentPane.add(lblNewLabel_4);
// proceso para crear el conteo de cliks
JButton PrimerCandidato = new JButton("Lista 5 "Creo"");
PrimerCandidato.setBounds(139, 359, 120, 31);
PrimerCandidato.addActionListener(new ActionListener() {
// contador del primer candidato
public int count = 0;
public void actionPerformed(ActionEvent e) {
count++;
String numero = String.valueOf(count); // cambio de text a
numerico
xd.setText((numero));
contentPane.setVisible(false); // al dar clic esconder el panel y
mostrar el mensaje
Component componentePadre = null;
JOptionPane.showMessageDialog(
componentePadre,
"Gracias por votar"); // mensaje del cuadro de
diálogo
contentPane.setVisible(true);
}
}
);contentPane.add(PrimerCandidato);
JButton Segundo = new JButton("Lista 21");
Segundo.setBounds(552, 359, 102, 31);
Segundo.addActionListener(new ActionListener() {
public int count1 = 0;
public void actionPerformed(ActionEvent e) {
count1++;
String numero1 = String.valueOf(count1);
xdd.setText((numero1));
contentPane.setVisible(false);
Component componentePadre = null;
JOptionPane.showMessageDialog(
componentePadre,
"Gracias por votar");
contentPane.setVisible(true);
}
}
);
contentPane.add(Segundo);
// boton para voto en blanco
JButton btnNewButton_2 = new JButton("Blanco");
btnNewButton_2.setBounds(139, 424, 102, 21);
btnNewButton_2.addActionListener(new ActionListener() {
public int count2 = 0;
public void actionPerformed(ActionEvent e) {
count2++;
String numero2 = String.valueOf(count2);
xddd.setText((numero2));
contentPane.setVisible(false);
Component componentePadre = null;
JOptionPane.showMessageDialog(
componentePadre,
"Gracias por votar");
contentPane.setVisible(true);
}
});
contentPane.add(btnNewButton_2);
// boton para nulo
JButton btnNewButton_3 = new JButton("Nulo");
btnNewButton_3.setBounds(552, 424, 102, 21);
btnNewButton_3.addActionListener(new ActionListener() {
public int count3 = 0;
public void actionPerformed(ActionEvent e) {
count3++;
String numero3 = String.valueOf(count3);
xdddd.setText((numero3));
contentPane.setVisible(false);
Component componentePadre = null;
JOptionPane.showMessageDialog(
componentePadre,
"Gracias por votar");
contentPane.setVisible(true);
}
});
contentPane.add(btnNewButton_3);
// boton para salir
JButton btnNewButton = new JButton("SALIR");
btnNewButton.setBounds(750, 513, 85, 21);
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(WIDTH);
}
});
contentPane.add(btnNewButton);
// boton de resultados
JButton btnNewButton_1 = new JButton("Resultados");
btnNewButton_1.setBounds(351, 455, 102, 21);
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// codigo para abrir el otro formulario
Resultados abrir = new Resultados();
//llamo al segundo formulario y el texto donde quiero pasar el dato
y luego coloco el dato creado " xd"
Resultados.PrimerC.setText(xd.getText());
Resultados.SegundoC.setText(xdd.getText());
Resultados.bl.setText(xddd.getText());
Resultados.nl.setText(xdddd.getText());
abrir.setVisible(true);
this.setVisible(false);
dispose();
}
private void setVisible(boolean b) {
}
});
contentPane.add(btnNewButton_1);
xd = new JTextField();
xd.setBackground(new Color(255, 255, 255));
xd.setVisible(false);
xd.setEnabled(false);
xd.setEditable(false);
xd.setBounds(115, 476, 96, 19);
contentPane.add(xd);
xd.setColumns(10);
xdd = new JTextField();
xdd.setBounds(115, 505, 96, 19);
xdd.setVisible(false);
contentPane.add(xdd);
xdd.setColumns(10);
xddd = new JTextField();
xddd.setEnabled(false);
xddd.setVisible(false);
xddd.setEditable(false);
xddd.setBounds(226, 476, 96, 19);
contentPane.add(xddd);
xddd.setColumns(10);
xdddd = new JTextField();
xdddd.setBounds(221, 505, 96, 19);
xdddd.setVisible(false);
contentPane.add(xdddd);
xdddd.setColumns(10);
}
public JTextField getTextField() {
return xd;
}
}
SEGUNDO FORMULARIO
package FormularioPolitica;
import java.awt.BorderLayout;
import java.awt.Component;
import java.awt.EventQueue;
import javax.swing.JFrame;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
//import jdk.nashorn.internal.runtime.ConsString;
//import dos.primero;//
import javax.swing.JLabel;
import javax.swing.JOptionPane;
import java.awt.Font;
import javax.swing.SwingConstants;
import javax.swing.JTextField;
import javax.swing.Icon;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.JTextPane;
import java.awt.Color;
import javax.swing.DropMode;
public class Politica extends JFrame {
public JPanel contentPane;
public JTextField xd;
public JTextField xdd;
private JTextField xddd;
private JTextField xdddd;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
Politica frame = new Politica();
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public Politica() {
Resultados resivir = new Resultados();
resivir.setVisible(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setBounds(100, 100, 859, 581);
contentPane = new JPanel();
contentPane.setBackground(new Color(204, 255, 255));
contentPane.setBorder(new EmptyBorder(5, 5, 5, 5));
setContentPane(contentPane);
contentPane.setLayout(null);
this.setLocationRelativeTo(null);
JLabel lblNewLabel_2 = new JLabel("Elecciones Presidenciales 2021");
lblNewLabel_2.setBounds(226, 10, 391, 47);
lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 22));
contentPane.add(lblNewLabel_2);
JLabel lblNewLabel = new JLabel("Guillermo Lasso");
lblNewLabel.setBounds(122, 83, 173, 31);
lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 20));
contentPane.add(lblNewLabel);
JLabel lblNewLabel_1 = new JLabel("Andru00E9s Arau00FAs");
lblNewLabel_1.setBounds(523, 87, 157, 22);
lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 20));
contentPane.add(lblNewLabel_1);
JLabel lblNewLabel_3 = new JLabel("");
lblNewLabel_3.setBounds(502, 146, 173, 165);
lblNewLabel_3.setIcon(new ImageIcon("C:UsersBlue.DotaDesktopimages.jfif"));
contentPane.add(lblNewLabel_3);
JLabel lblNewLabel_4 = new JLabel("");
lblNewLabel_4.setBounds(103, 146, 173, 165);
lblNewLabel_4.setIcon(new ImageIcon("C:UsersBlue.DotaDesktoplll.jfif"));
contentPane.add(lblNewLabel_4);
// proceso para crear el conteo de cliks
JButton PrimerCandidato = new JButton("Lista 5 "Creo"");
PrimerCandidato.setBounds(139, 359, 120, 31);
PrimerCandidato.addActionListener(new ActionListener() {
// contador del primer candidato
public int count = 0;
public void actionPerformed(ActionEvent e) {
count++;
String numero = String.valueOf(count); // cambio de text a numerico
xd.setText((numero));
contentPane.setVisible(false); // al dar clic esconder el panel y mostrar el
mensaje
Component componentePadre = null;
JOptionPane.showMessageDialog(
componentePadre,
"Gracias por votar"); // mensaje del cuadro de diálogo
contentPane.setVisible(true);
}
}
);contentPane.add(PrimerCandidato);
JButton Segundo = new JButton("Lista 21");
Segundo.setBounds(552, 359, 102, 31);
Segundo.addActionListener(new ActionListener() {
public int count1 = 0;
public void actionPerformed(ActionEvent e) {
count1++;
String numero1 = String.valueOf(count1);
xdd.setText((numero1));
contentPane.setVisible(false);
Component componentePadre = null;
JOptionPane.showMessageDialog(
componentePadre,
"Gracias por votar");
contentPane.setVisible(true);
}
}
);
contentPane.add(Segundo);
// boton para voto en blanco
JButton btnNewButton_2 = new JButton("Blanco");
btnNewButton_2.setBounds(139, 424, 102, 21);
btnNewButton_2.addActionListener(new ActionListener() {
public int count2 = 0;
public void actionPerformed(ActionEvent e) {
count2++;
String numero2 = String.valueOf(count2);
xddd.setText((numero2));
contentPane.setVisible(false);
Component componentePadre = null;
JOptionPane.showMessageDialog(
componentePadre,
"Gracias por votar");
contentPane.setVisible(true);
}
});
contentPane.add(btnNewButton_2);
// boton para nulo
JButton btnNewButton_3 = new JButton("Nulo");
btnNewButton_3.setBounds(552, 424, 102, 21);
btnNewButton_3.addActionListener(new ActionListener() {
public int count3 = 0;
public void actionPerformed(ActionEvent e) {
count3++;
String numero3 = String.valueOf(count3);
xdddd.setText((numero3));
contentPane.setVisible(false);
Component componentePadre = null;
JOptionPane.showMessageDialog(
componentePadre,
"Gracias por votar");
contentPane.setVisible(true);
}
});
contentPane.add(btnNewButton_3);
// boton para salir
JButton btnNewButton = new JButton("SALIR");
btnNewButton.setBounds(750, 513, 85, 21);
btnNewButton.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
System.exit(WIDTH);
}
});
contentPane.add(btnNewButton);
// boton de resultados
JButton btnNewButton_1 = new JButton("Resultados");
btnNewButton_1.setBounds(351, 455, 102, 21);
btnNewButton_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// codigo para abrir el otro formulario
Resultados abrir = new Resultados();
//llamo al segundo formulario y el texto donde quiero pasar el dato y luego
coloco el dato creado " xd"
Resultados.PrimerC.setText(xd.getText());
Resultados.SegundoC.setText(xdd.getText());
Resultados.bl.setText(xddd.getText());
Resultados.nl.setText(xdddd.getText());
abrir.setVisible(true);
this.setVisible(false);
dispose();
}
private void setVisible(boolean b) {
}
});
contentPane.add(btnNewButton_1);
xd = new JTextField();
xd.setBackground(new Color(255, 255, 255));
xd.setVisible(false);
xd.setEnabled(false);
xd.setEditable(false);
xd.setBounds(115, 476, 96, 19);
contentPane.add(xd);
xd.setColumns(10);
xdd = new JTextField();
xdd.setBounds(115, 505, 96, 19);
xdd.setVisible(false);
contentPane.add(xdd);
xdd.setColumns(10);
xddd = new JTextField();
xddd.setEnabled(false);
xddd.setVisible(false);
xddd.setEditable(false);
xddd.setBounds(226, 476, 96, 19);
contentPane.add(xddd);
xddd.setColumns(10);
xdddd = new JTextField();
xdddd.setBounds(221, 505, 96, 19);
xdddd.setVisible(false);
contentPane.add(xdddd);
xdddd.setColumns(10);
}
public JTextField getTextField() {
return xd;
}
}
f.)
____ _______ f.) __________________
MSc. Víctor Zapata
ESTUDIANTE DOCENTE

Más contenido relacionado

La actualidad más candente

Informe#18
Informe#18Informe#18
Informe#18
paulcuenca9
 
Formulario u4tema4
Formulario u4tema4Formulario u4tema4
Formulario u4tema4
JeffersonAguachela
 
Informe#21
Informe#21Informe#21
Informe#21
paulcuenca9
 
In 9
In 9In 9
18 por
18 por18 por
18 por
JuanSimbaa8
 
18
1818
Unid 4 tema 4
Unid 4  tema 4Unid 4  tema 4
Unid 4 tema 4
JeffersonGuaman10
 
In 4
In 4In 4
In 7
In 7In 7
21 porta
21 porta21 porta
21 porta
JuanSimbaa8
 
In 15
In 15In 15
Informe#17
Informe#17Informe#17
Informe#17
paulcuenca9
 
In 6
In 6In 6
Informe u4tema3
Informe u4tema3Informe u4tema3
Informe u4tema3
JeffersonAguachela
 
Unidad 4 tema 3
Unidad 4  tema 3Unidad 4  tema 3
Unidad 4 tema 3
JeffersonGuaman10
 
In 3
In 3In 3
Informe u4tema3.2
Informe u4tema3.2Informe u4tema3.2
Informe u4tema3.2
JeffersonAguachela
 
In 13
In 13In 13
Unidad 4 tema 2
Unidad 4  tema 2Unidad 4  tema 2
Unidad 4 tema 2
JeffersonGuaman10
 
In 2
In 2In 2

La actualidad más candente (20)

Informe#18
Informe#18Informe#18
Informe#18
 
Formulario u4tema4
Formulario u4tema4Formulario u4tema4
Formulario u4tema4
 
Informe#21
Informe#21Informe#21
Informe#21
 
In 9
In 9In 9
In 9
 
18 por
18 por18 por
18 por
 
18
1818
18
 
Unid 4 tema 4
Unid 4  tema 4Unid 4  tema 4
Unid 4 tema 4
 
In 4
In 4In 4
In 4
 
In 7
In 7In 7
In 7
 
21 porta
21 porta21 porta
21 porta
 
In 15
In 15In 15
In 15
 
Informe#17
Informe#17Informe#17
Informe#17
 
In 6
In 6In 6
In 6
 
Informe u4tema3
Informe u4tema3Informe u4tema3
Informe u4tema3
 
Unidad 4 tema 3
Unidad 4  tema 3Unidad 4  tema 3
Unidad 4 tema 3
 
In 3
In 3In 3
In 3
 
Informe u4tema3.2
Informe u4tema3.2Informe u4tema3.2
Informe u4tema3.2
 
In 13
In 13In 13
In 13
 
Unidad 4 tema 2
Unidad 4  tema 2Unidad 4  tema 2
Unidad 4 tema 2
 
In 2
In 2In 2
In 2
 

Similar a In 22

22
2222
24
2424
12.gráficos y bases de datos
12.gráficos y bases de datos12.gráficos y bases de datos
12.gráficos y bases de datos
Ramiro Estigarribia Canese
 
Manual marichuy
Manual marichuyManual marichuy
Manual marichuy
Manual marichuyManual marichuy
Informe#23
Informe#23Informe#23
Informe#23
paulcuenca9
 
Manual marichuy
Manual marichuyManual marichuy
Manual marichuy
Manual marichuyManual marichuy
Manual marichuy
Manual marichuyManual marichuy
Informe#25
Informe#25Informe#25
Informe#25
paulcuenca9
 
Tips componentes swing_v5
Tips componentes swing_v5Tips componentes swing_v5
Tips componentes swing_v5
ggzhack
 
Hebras
HebrasHebras
Hebras
Tensor
 
Mp mardoqueo informe tecnico tap
Mp mardoqueo informe tecnico tapMp mardoqueo informe tecnico tap
Mp mardoqueo informe tecnico tap
Mardoqueo Mateo Pedro
 
Clases de php
Clases de phpClases de php
Clases de php
Edwin Calle Terrazas
 
Android
AndroidAndroid
Acmar trucos de visual basic(2)
Acmar   trucos de visual basic(2)Acmar   trucos de visual basic(2)
Acmar trucos de visual basic(2)
Ivan Ramirez Iglesias
 
Aplicación zirconia
Aplicación zirconiaAplicación zirconia
Aplicación zirconia
Cristian Omar Jaramillo Méndez
 
Programas
ProgramasProgramas
Programas
Beto Aldana
 
Manual de shine system
Manual de shine systemManual de shine system
Manual de shine system
Rafa
 
Android Bootcamp - GTUG Uruguay
Android Bootcamp - GTUG UruguayAndroid Bootcamp - GTUG Uruguay
Android Bootcamp - GTUG Uruguay
gtuguruguay
 

Similar a In 22 (20)

22
2222
22
 
24
2424
24
 
12.gráficos y bases de datos
12.gráficos y bases de datos12.gráficos y bases de datos
12.gráficos y bases de datos
 
Manual marichuy
Manual marichuyManual marichuy
Manual marichuy
 
Manual marichuy
Manual marichuyManual marichuy
Manual marichuy
 
Informe#23
Informe#23Informe#23
Informe#23
 
Manual marichuy
Manual marichuyManual marichuy
Manual marichuy
 
Manual marichuy
Manual marichuyManual marichuy
Manual marichuy
 
Manual marichuy
Manual marichuyManual marichuy
Manual marichuy
 
Informe#25
Informe#25Informe#25
Informe#25
 
Tips componentes swing_v5
Tips componentes swing_v5Tips componentes swing_v5
Tips componentes swing_v5
 
Hebras
HebrasHebras
Hebras
 
Mp mardoqueo informe tecnico tap
Mp mardoqueo informe tecnico tapMp mardoqueo informe tecnico tap
Mp mardoqueo informe tecnico tap
 
Clases de php
Clases de phpClases de php
Clases de php
 
Android
AndroidAndroid
Android
 
Acmar trucos de visual basic(2)
Acmar   trucos de visual basic(2)Acmar   trucos de visual basic(2)
Acmar trucos de visual basic(2)
 
Aplicación zirconia
Aplicación zirconiaAplicación zirconia
Aplicación zirconia
 
Programas
ProgramasProgramas
Programas
 
Manual de shine system
Manual de shine systemManual de shine system
Manual de shine system
 
Android Bootcamp - GTUG Uruguay
Android Bootcamp - GTUG UruguayAndroid Bootcamp - GTUG Uruguay
Android Bootcamp - GTUG Uruguay
 

Más de LENINMATEO1

Examen
ExamenExamen
Examen
LENINMATEO1
 
Chatbot
ChatbotChatbot
Chatbot
LENINMATEO1
 
Cheque
ChequeCheque
Cheque
LENINMATEO1
 
Ejercicios basicos php lenin quishpe
Ejercicios basicos php lenin quishpeEjercicios basicos php lenin quishpe
Ejercicios basicos php lenin quishpe
LENINMATEO1
 
Tabla de multiplicar con for y while
Tabla de multiplicar con for y whileTabla de multiplicar con for y while
Tabla de multiplicar con for y while
LENINMATEO1
 
Tabla de multiplicar con for
Tabla de multiplicar con forTabla de multiplicar con for
Tabla de multiplicar con for
LENINMATEO1
 
Tabla de multiplicar con while
Tabla de multiplicar con whileTabla de multiplicar con while
Tabla de multiplicar con while
LENINMATEO1
 
Tarea con switch
Tarea con switchTarea con switch
Tarea con switch
LENINMATEO1
 
Uso de variables en php
Uso de variables en phpUso de variables en php
Uso de variables en php
LENINMATEO1
 
In 29
In 29In 29
In 28
In 28In 28
In 27
In 27In 27
In 26
In 26In 26
In 25
In 25In 25
In 24
In 24In 24
In 23
In 23In 23
In 22
In 22In 22
In 21
In 21In 21
In 20
In 20In 20
In 18
In 18In 18

Más de LENINMATEO1 (20)

Examen
ExamenExamen
Examen
 
Chatbot
ChatbotChatbot
Chatbot
 
Cheque
ChequeCheque
Cheque
 
Ejercicios basicos php lenin quishpe
Ejercicios basicos php lenin quishpeEjercicios basicos php lenin quishpe
Ejercicios basicos php lenin quishpe
 
Tabla de multiplicar con for y while
Tabla de multiplicar con for y whileTabla de multiplicar con for y while
Tabla de multiplicar con for y while
 
Tabla de multiplicar con for
Tabla de multiplicar con forTabla de multiplicar con for
Tabla de multiplicar con for
 
Tabla de multiplicar con while
Tabla de multiplicar con whileTabla de multiplicar con while
Tabla de multiplicar con while
 
Tarea con switch
Tarea con switchTarea con switch
Tarea con switch
 
Uso de variables en php
Uso de variables en phpUso de variables en php
Uso de variables en php
 
In 29
In 29In 29
In 29
 
In 28
In 28In 28
In 28
 
In 27
In 27In 27
In 27
 
In 26
In 26In 26
In 26
 
In 25
In 25In 25
In 25
 
In 24
In 24In 24
In 24
 
In 23
In 23In 23
In 23
 
In 22
In 22In 22
In 22
 
In 21
In 21In 21
In 21
 
In 20
In 20In 20
In 20
 
In 18
In 18In 18
In 18
 

Último

APUNTES UNIDAD I ECONOMIA EMPRESARIAL .pdf
APUNTES UNIDAD I ECONOMIA EMPRESARIAL .pdfAPUNTES UNIDAD I ECONOMIA EMPRESARIAL .pdf
APUNTES UNIDAD I ECONOMIA EMPRESARIAL .pdf
VeronicaCabrera50
 
ACERTIJO DESCIFRANDO CÓDIGO DEL CANDADO DE LA TORRE EIFFEL EN PARÍS. Por JAVI...
ACERTIJO DESCIFRANDO CÓDIGO DEL CANDADO DE LA TORRE EIFFEL EN PARÍS. Por JAVI...ACERTIJO DESCIFRANDO CÓDIGO DEL CANDADO DE LA TORRE EIFFEL EN PARÍS. Por JAVI...
ACERTIJO DESCIFRANDO CÓDIGO DEL CANDADO DE LA TORRE EIFFEL EN PARÍS. Por JAVI...
JAVIER SOLIS NOYOLA
 
Los Dominios y Reinos de los Seres Vivos
Los Dominios y Reinos de los Seres VivosLos Dominios y Reinos de los Seres Vivos
Los Dominios y Reinos de los Seres Vivos
karlafreire0608
 
RETROALIMENTACIÓN PARA EL EXAMEN ÚNICO AUXILIAR DE ENFERMERIA.docx
RETROALIMENTACIÓN PARA EL EXAMEN ÚNICO AUXILIAR DE ENFERMERIA.docxRETROALIMENTACIÓN PARA EL EXAMEN ÚNICO AUXILIAR DE ENFERMERIA.docx
RETROALIMENTACIÓN PARA EL EXAMEN ÚNICO AUXILIAR DE ENFERMERIA.docx
100078171
 
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdf
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdfMundo ABC Examen 1 Grado- Tercer Trimestre.pdf
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdf
ViriEsteva
 
MATERIAL ESCOLAR 2024-2025. 4 AÑOS CEIP SAN CRISTOBAL
MATERIAL ESCOLAR 2024-2025. 4 AÑOS CEIP SAN CRISTOBALMATERIAL ESCOLAR 2024-2025. 4 AÑOS CEIP SAN CRISTOBAL
MATERIAL ESCOLAR 2024-2025. 4 AÑOS CEIP SAN CRISTOBAL
Ana Fernandez
 
Inteligencia Artificial y Aprendizaje Activo FLACSO Ccesa007.pdf
Inteligencia Artificial  y Aprendizaje Activo FLACSO  Ccesa007.pdfInteligencia Artificial  y Aprendizaje Activo FLACSO  Ccesa007.pdf
Inteligencia Artificial y Aprendizaje Activo FLACSO Ccesa007.pdf
Demetrio Ccesa Rayme
 
p4s.co Ecosistema de Ecosistemas - Diagrama.pdf
p4s.co Ecosistema de Ecosistemas - Diagrama.pdfp4s.co Ecosistema de Ecosistemas - Diagrama.pdf
p4s.co Ecosistema de Ecosistemas - Diagrama.pdf
DavidCamiloMosquera
 
Camus, Albert - El Extranjero.pdf
Camus, Albert -        El Extranjero.pdfCamus, Albert -        El Extranjero.pdf
Camus, Albert - El Extranjero.pdf
AlexDeLonghi
 
Escuela Sabática. El conflicto inminente.pdf
Escuela Sabática. El conflicto inminente.pdfEscuela Sabática. El conflicto inminente.pdf
Escuela Sabática. El conflicto inminente.pdf
Alejandrino Halire Ccahuana
 
DESARROLLO DE LAS RELACIONES CON LOS STAKEHOLDERS.pdf
DESARROLLO DE LAS RELACIONES CON LOS STAKEHOLDERS.pdfDESARROLLO DE LAS RELACIONES CON LOS STAKEHOLDERS.pdf
DESARROLLO DE LAS RELACIONES CON LOS STAKEHOLDERS.pdf
JonathanCovena1
 
Chatgpt para los Profesores Ccesa007.pdf
Chatgpt para los Profesores Ccesa007.pdfChatgpt para los Profesores Ccesa007.pdf
Chatgpt para los Profesores Ccesa007.pdf
Demetrio Ccesa Rayme
 
Evaluacion del tercer trimestre del 2023-2024
Evaluacion del tercer trimestre del 2023-2024Evaluacion del tercer trimestre del 2023-2024
Evaluacion del tercer trimestre del 2023-2024
israelsouza67
 
La necesidad de bienestar y el uso de la naturaleza.pdf
La necesidad de bienestar y el uso de la naturaleza.pdfLa necesidad de bienestar y el uso de la naturaleza.pdf
La necesidad de bienestar y el uso de la naturaleza.pdf
JonathanCovena1
 
Power Point: El conflicto inminente (Bosquejo)
Power Point: El conflicto inminente (Bosquejo)Power Point: El conflicto inminente (Bosquejo)
Power Point: El conflicto inminente (Bosquejo)
https://gramadal.wordpress.com/
 
Compartir p4s.co Pitch Hackathon Template Plantilla final.pptx-2.pdf
Compartir p4s.co Pitch Hackathon Template Plantilla final.pptx-2.pdfCompartir p4s.co Pitch Hackathon Template Plantilla final.pptx-2.pdf
Compartir p4s.co Pitch Hackathon Template Plantilla final.pptx-2.pdf
JimmyDeveloperWebAnd
 
CINE COMO RECURSO DIDÁCTICO para utilizar en TUTORÍA
CINE COMO RECURSO DIDÁCTICO para utilizar en TUTORÍACINE COMO RECURSO DIDÁCTICO para utilizar en TUTORÍA
CINE COMO RECURSO DIDÁCTICO para utilizar en TUTORÍA
Fernández Gorka
 
Prueba/test conoce tus heridas de la infancia
Prueba/test conoce tus heridas de la infanciaPrueba/test conoce tus heridas de la infancia
Prueba/test conoce tus heridas de la infancia
LudmilaOrtega3
 
tema 7. Los siglos XVI y XVII ( resumen)
tema 7. Los siglos XVI y XVII ( resumen)tema 7. Los siglos XVI y XVII ( resumen)
tema 7. Los siglos XVI y XVII ( resumen)
saradocente
 
Manual de procedimiento para gráficos HC
Manual de procedimiento para gráficos HCManual de procedimiento para gráficos HC
Manual de procedimiento para gráficos HC
josseanlo1581
 

Último (20)

APUNTES UNIDAD I ECONOMIA EMPRESARIAL .pdf
APUNTES UNIDAD I ECONOMIA EMPRESARIAL .pdfAPUNTES UNIDAD I ECONOMIA EMPRESARIAL .pdf
APUNTES UNIDAD I ECONOMIA EMPRESARIAL .pdf
 
ACERTIJO DESCIFRANDO CÓDIGO DEL CANDADO DE LA TORRE EIFFEL EN PARÍS. Por JAVI...
ACERTIJO DESCIFRANDO CÓDIGO DEL CANDADO DE LA TORRE EIFFEL EN PARÍS. Por JAVI...ACERTIJO DESCIFRANDO CÓDIGO DEL CANDADO DE LA TORRE EIFFEL EN PARÍS. Por JAVI...
ACERTIJO DESCIFRANDO CÓDIGO DEL CANDADO DE LA TORRE EIFFEL EN PARÍS. Por JAVI...
 
Los Dominios y Reinos de los Seres Vivos
Los Dominios y Reinos de los Seres VivosLos Dominios y Reinos de los Seres Vivos
Los Dominios y Reinos de los Seres Vivos
 
RETROALIMENTACIÓN PARA EL EXAMEN ÚNICO AUXILIAR DE ENFERMERIA.docx
RETROALIMENTACIÓN PARA EL EXAMEN ÚNICO AUXILIAR DE ENFERMERIA.docxRETROALIMENTACIÓN PARA EL EXAMEN ÚNICO AUXILIAR DE ENFERMERIA.docx
RETROALIMENTACIÓN PARA EL EXAMEN ÚNICO AUXILIAR DE ENFERMERIA.docx
 
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdf
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdfMundo ABC Examen 1 Grado- Tercer Trimestre.pdf
Mundo ABC Examen 1 Grado- Tercer Trimestre.pdf
 
MATERIAL ESCOLAR 2024-2025. 4 AÑOS CEIP SAN CRISTOBAL
MATERIAL ESCOLAR 2024-2025. 4 AÑOS CEIP SAN CRISTOBALMATERIAL ESCOLAR 2024-2025. 4 AÑOS CEIP SAN CRISTOBAL
MATERIAL ESCOLAR 2024-2025. 4 AÑOS CEIP SAN CRISTOBAL
 
Inteligencia Artificial y Aprendizaje Activo FLACSO Ccesa007.pdf
Inteligencia Artificial  y Aprendizaje Activo FLACSO  Ccesa007.pdfInteligencia Artificial  y Aprendizaje Activo FLACSO  Ccesa007.pdf
Inteligencia Artificial y Aprendizaje Activo FLACSO Ccesa007.pdf
 
p4s.co Ecosistema de Ecosistemas - Diagrama.pdf
p4s.co Ecosistema de Ecosistemas - Diagrama.pdfp4s.co Ecosistema de Ecosistemas - Diagrama.pdf
p4s.co Ecosistema de Ecosistemas - Diagrama.pdf
 
Camus, Albert - El Extranjero.pdf
Camus, Albert -        El Extranjero.pdfCamus, Albert -        El Extranjero.pdf
Camus, Albert - El Extranjero.pdf
 
Escuela Sabática. El conflicto inminente.pdf
Escuela Sabática. El conflicto inminente.pdfEscuela Sabática. El conflicto inminente.pdf
Escuela Sabática. El conflicto inminente.pdf
 
DESARROLLO DE LAS RELACIONES CON LOS STAKEHOLDERS.pdf
DESARROLLO DE LAS RELACIONES CON LOS STAKEHOLDERS.pdfDESARROLLO DE LAS RELACIONES CON LOS STAKEHOLDERS.pdf
DESARROLLO DE LAS RELACIONES CON LOS STAKEHOLDERS.pdf
 
Chatgpt para los Profesores Ccesa007.pdf
Chatgpt para los Profesores Ccesa007.pdfChatgpt para los Profesores Ccesa007.pdf
Chatgpt para los Profesores Ccesa007.pdf
 
Evaluacion del tercer trimestre del 2023-2024
Evaluacion del tercer trimestre del 2023-2024Evaluacion del tercer trimestre del 2023-2024
Evaluacion del tercer trimestre del 2023-2024
 
La necesidad de bienestar y el uso de la naturaleza.pdf
La necesidad de bienestar y el uso de la naturaleza.pdfLa necesidad de bienestar y el uso de la naturaleza.pdf
La necesidad de bienestar y el uso de la naturaleza.pdf
 
Power Point: El conflicto inminente (Bosquejo)
Power Point: El conflicto inminente (Bosquejo)Power Point: El conflicto inminente (Bosquejo)
Power Point: El conflicto inminente (Bosquejo)
 
Compartir p4s.co Pitch Hackathon Template Plantilla final.pptx-2.pdf
Compartir p4s.co Pitch Hackathon Template Plantilla final.pptx-2.pdfCompartir p4s.co Pitch Hackathon Template Plantilla final.pptx-2.pdf
Compartir p4s.co Pitch Hackathon Template Plantilla final.pptx-2.pdf
 
CINE COMO RECURSO DIDÁCTICO para utilizar en TUTORÍA
CINE COMO RECURSO DIDÁCTICO para utilizar en TUTORÍACINE COMO RECURSO DIDÁCTICO para utilizar en TUTORÍA
CINE COMO RECURSO DIDÁCTICO para utilizar en TUTORÍA
 
Prueba/test conoce tus heridas de la infancia
Prueba/test conoce tus heridas de la infanciaPrueba/test conoce tus heridas de la infancia
Prueba/test conoce tus heridas de la infancia
 
tema 7. Los siglos XVI y XVII ( resumen)
tema 7. Los siglos XVI y XVII ( resumen)tema 7. Los siglos XVI y XVII ( resumen)
tema 7. Los siglos XVI y XVII ( resumen)
 
Manual de procedimiento para gráficos HC
Manual de procedimiento para gráficos HCManual de procedimiento para gráficos HC
Manual de procedimiento para gráficos HC
 

In 22

  • 1. INFORME ESTUDIANETE: Lenin Quishpe SEMESTRE: Segundo PARALELO: C PRÁCTICA #21 TEMA: Desarrollo de nuestra practica veintiuno en ECLIPSE. OBJETIVO: -Conocereldesarrollodeunprogramaen“Eclipse”,paraestedesarrollotendremosquecomprender lo que son los formularios en Windows builder. RESULTADOS DE APRENDIZAJE -Comprensión de la aplicación de Eclipse. -Uso correcto del código que aplicaremos en Eclipse. -Aprender el uso correcto de los formularios - Aprender a hacer operaciones básicas en un formulario ACTIVIDADES: -Realizar un programa que con los votos de los presidentes DESARROLLO DE CONTENIDOS package FormularioPolitica; import java.awt.BorderLayout; import java.awt.Component; import java.awt.EventQueue;
  • 2. import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; //import jdk.nashorn.internal.runtime.ConsString; //import dos.primero;// import javax.swing.JLabel; import javax.swing.JOptionPane; import java.awt.Font; import javax.swing.SwingConstants; import javax.swing.JTextField; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JTextPane; import java.awt.Color; import javax.swing.DropMode; public class Politica extends JFrame { public JPanel contentPane; public JTextField xd; public JTextField xdd; private JTextField xddd; private JTextField xdddd; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Politica frame = new Politica(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public Politica() { Resultados resivir = new Resultados(); resivir.setVisible(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
  • 3. setBounds(100, 100, 859, 581); contentPane = new JPanel(); contentPane.setBackground(new Color(204, 255, 255)); contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); this.setLocationRelativeTo(null); JLabel lblNewLabel_2 = new JLabel("Elecciones Presidenciales 2021"); lblNewLabel_2.setBounds(226, 10, 391, 47); lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER); lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 22)); contentPane.add(lblNewLabel_2); JLabel lblNewLabel = new JLabel("Guillermo Lasso"); lblNewLabel.setBounds(122, 83, 173, 31); lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 20)); contentPane.add(lblNewLabel); JLabel lblNewLabel_1 = new JLabel("Andru00E9s Arau00FAs"); lblNewLabel_1.setBounds(523, 87, 157, 22); lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 20)); contentPane.add(lblNewLabel_1); JLabel lblNewLabel_3 = new JLabel(""); lblNewLabel_3.setBounds(502, 146, 173, 165); lblNewLabel_3.setIcon(new ImageIcon("C:UsersBlue.DotaDesktopimages.jfif")); contentPane.add(lblNewLabel_3); JLabel lblNewLabel_4 = new JLabel(""); lblNewLabel_4.setBounds(103, 146, 173, 165); lblNewLabel_4.setIcon(new ImageIcon("C:UsersBlue.DotaDesktoplll.jfif")); contentPane.add(lblNewLabel_4); // proceso para crear el conteo de cliks JButton PrimerCandidato = new JButton("Lista 5 "Creo""); PrimerCandidato.setBounds(139, 359, 120, 31); PrimerCandidato.addActionListener(new ActionListener() { // contador del primer candidato public int count = 0; public void actionPerformed(ActionEvent e) { count++; String numero = String.valueOf(count); // cambio de text a numerico xd.setText((numero)); contentPane.setVisible(false); // al dar clic esconder el panel y mostrar el mensaje Component componentePadre = null;
  • 4. JOptionPane.showMessageDialog( componentePadre, "Gracias por votar"); // mensaje del cuadro de diálogo contentPane.setVisible(true); } } );contentPane.add(PrimerCandidato); JButton Segundo = new JButton("Lista 21"); Segundo.setBounds(552, 359, 102, 31); Segundo.addActionListener(new ActionListener() { public int count1 = 0; public void actionPerformed(ActionEvent e) { count1++; String numero1 = String.valueOf(count1); xdd.setText((numero1)); contentPane.setVisible(false); Component componentePadre = null; JOptionPane.showMessageDialog( componentePadre, "Gracias por votar"); contentPane.setVisible(true); } } ); contentPane.add(Segundo); // boton para voto en blanco JButton btnNewButton_2 = new JButton("Blanco"); btnNewButton_2.setBounds(139, 424, 102, 21); btnNewButton_2.addActionListener(new ActionListener() { public int count2 = 0; public void actionPerformed(ActionEvent e) { count2++; String numero2 = String.valueOf(count2); xddd.setText((numero2)); contentPane.setVisible(false); Component componentePadre = null; JOptionPane.showMessageDialog( componentePadre, "Gracias por votar");
  • 5. contentPane.setVisible(true); } }); contentPane.add(btnNewButton_2); // boton para nulo JButton btnNewButton_3 = new JButton("Nulo"); btnNewButton_3.setBounds(552, 424, 102, 21); btnNewButton_3.addActionListener(new ActionListener() { public int count3 = 0; public void actionPerformed(ActionEvent e) { count3++; String numero3 = String.valueOf(count3); xdddd.setText((numero3)); contentPane.setVisible(false); Component componentePadre = null; JOptionPane.showMessageDialog( componentePadre, "Gracias por votar"); contentPane.setVisible(true); } }); contentPane.add(btnNewButton_3); // boton para salir JButton btnNewButton = new JButton("SALIR"); btnNewButton.setBounds(750, 513, 85, 21); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(WIDTH); } }); contentPane.add(btnNewButton); // boton de resultados JButton btnNewButton_1 = new JButton("Resultados"); btnNewButton_1.setBounds(351, 455, 102, 21); btnNewButton_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // codigo para abrir el otro formulario
  • 6. Resultados abrir = new Resultados(); //llamo al segundo formulario y el texto donde quiero pasar el dato y luego coloco el dato creado " xd" Resultados.PrimerC.setText(xd.getText()); Resultados.SegundoC.setText(xdd.getText()); Resultados.bl.setText(xddd.getText()); Resultados.nl.setText(xdddd.getText()); abrir.setVisible(true); this.setVisible(false); dispose(); } private void setVisible(boolean b) { } }); contentPane.add(btnNewButton_1); xd = new JTextField(); xd.setBackground(new Color(255, 255, 255)); xd.setVisible(false); xd.setEnabled(false); xd.setEditable(false); xd.setBounds(115, 476, 96, 19); contentPane.add(xd); xd.setColumns(10); xdd = new JTextField(); xdd.setBounds(115, 505, 96, 19); xdd.setVisible(false); contentPane.add(xdd); xdd.setColumns(10); xddd = new JTextField(); xddd.setEnabled(false); xddd.setVisible(false); xddd.setEditable(false); xddd.setBounds(226, 476, 96, 19); contentPane.add(xddd); xddd.setColumns(10); xdddd = new JTextField(); xdddd.setBounds(221, 505, 96, 19); xdddd.setVisible(false); contentPane.add(xdddd); xdddd.setColumns(10); } public JTextField getTextField() {
  • 7. return xd; } } SEGUNDO FORMULARIO package FormularioPolitica; import java.awt.BorderLayout; import java.awt.Component; import java.awt.EventQueue; import javax.swing.JFrame; import javax.swing.JPanel; import javax.swing.border.EmptyBorder; //import jdk.nashorn.internal.runtime.ConsString; //import dos.primero;// import javax.swing.JLabel; import javax.swing.JOptionPane; import java.awt.Font; import javax.swing.SwingConstants; import javax.swing.JTextField; import javax.swing.Icon; import javax.swing.ImageIcon; import javax.swing.JButton; import java.awt.event.ActionListener; import java.awt.event.ActionEvent; import javax.swing.JTextPane; import java.awt.Color; import javax.swing.DropMode; public class Politica extends JFrame {
  • 8. public JPanel contentPane; public JTextField xd; public JTextField xdd; private JTextField xddd; private JTextField xdddd; /** * Launch the application. */ public static void main(String[] args) { EventQueue.invokeLater(new Runnable() { public void run() { try { Politica frame = new Politica(); frame.setVisible(true); } catch (Exception e) { e.printStackTrace(); } } }); } /** * Create the frame. */ public Politica() { Resultados resivir = new Resultados(); resivir.setVisible(false); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setBounds(100, 100, 859, 581); contentPane = new JPanel(); contentPane.setBackground(new Color(204, 255, 255));
  • 9. contentPane.setBorder(new EmptyBorder(5, 5, 5, 5)); setContentPane(contentPane); contentPane.setLayout(null); this.setLocationRelativeTo(null); JLabel lblNewLabel_2 = new JLabel("Elecciones Presidenciales 2021"); lblNewLabel_2.setBounds(226, 10, 391, 47); lblNewLabel_2.setHorizontalAlignment(SwingConstants.CENTER); lblNewLabel_2.setFont(new Font("Tahoma", Font.PLAIN, 22)); contentPane.add(lblNewLabel_2); JLabel lblNewLabel = new JLabel("Guillermo Lasso"); lblNewLabel.setBounds(122, 83, 173, 31); lblNewLabel.setFont(new Font("Tahoma", Font.PLAIN, 20)); contentPane.add(lblNewLabel); JLabel lblNewLabel_1 = new JLabel("Andru00E9s Arau00FAs"); lblNewLabel_1.setBounds(523, 87, 157, 22); lblNewLabel_1.setFont(new Font("Tahoma", Font.PLAIN, 20)); contentPane.add(lblNewLabel_1); JLabel lblNewLabel_3 = new JLabel(""); lblNewLabel_3.setBounds(502, 146, 173, 165); lblNewLabel_3.setIcon(new ImageIcon("C:UsersBlue.DotaDesktopimages.jfif")); contentPane.add(lblNewLabel_3); JLabel lblNewLabel_4 = new JLabel(""); lblNewLabel_4.setBounds(103, 146, 173, 165); lblNewLabel_4.setIcon(new ImageIcon("C:UsersBlue.DotaDesktoplll.jfif")); contentPane.add(lblNewLabel_4); // proceso para crear el conteo de cliks
  • 10. JButton PrimerCandidato = new JButton("Lista 5 "Creo""); PrimerCandidato.setBounds(139, 359, 120, 31); PrimerCandidato.addActionListener(new ActionListener() { // contador del primer candidato public int count = 0; public void actionPerformed(ActionEvent e) { count++; String numero = String.valueOf(count); // cambio de text a numerico xd.setText((numero)); contentPane.setVisible(false); // al dar clic esconder el panel y mostrar el mensaje Component componentePadre = null; JOptionPane.showMessageDialog( componentePadre, "Gracias por votar"); // mensaje del cuadro de diálogo contentPane.setVisible(true); } } );contentPane.add(PrimerCandidato); JButton Segundo = new JButton("Lista 21"); Segundo.setBounds(552, 359, 102, 31); Segundo.addActionListener(new ActionListener() { public int count1 = 0; public void actionPerformed(ActionEvent e) {
  • 11. count1++; String numero1 = String.valueOf(count1); xdd.setText((numero1)); contentPane.setVisible(false); Component componentePadre = null; JOptionPane.showMessageDialog( componentePadre, "Gracias por votar"); contentPane.setVisible(true); } } ); contentPane.add(Segundo); // boton para voto en blanco JButton btnNewButton_2 = new JButton("Blanco"); btnNewButton_2.setBounds(139, 424, 102, 21); btnNewButton_2.addActionListener(new ActionListener() { public int count2 = 0; public void actionPerformed(ActionEvent e) { count2++; String numero2 = String.valueOf(count2); xddd.setText((numero2)); contentPane.setVisible(false); Component componentePadre = null; JOptionPane.showMessageDialog( componentePadre,
  • 12. "Gracias por votar"); contentPane.setVisible(true); } }); contentPane.add(btnNewButton_2); // boton para nulo JButton btnNewButton_3 = new JButton("Nulo"); btnNewButton_3.setBounds(552, 424, 102, 21); btnNewButton_3.addActionListener(new ActionListener() { public int count3 = 0; public void actionPerformed(ActionEvent e) { count3++; String numero3 = String.valueOf(count3); xdddd.setText((numero3)); contentPane.setVisible(false); Component componentePadre = null; JOptionPane.showMessageDialog( componentePadre, "Gracias por votar"); contentPane.setVisible(true); } }); contentPane.add(btnNewButton_3); // boton para salir
  • 13. JButton btnNewButton = new JButton("SALIR"); btnNewButton.setBounds(750, 513, 85, 21); btnNewButton.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { System.exit(WIDTH); } }); contentPane.add(btnNewButton); // boton de resultados JButton btnNewButton_1 = new JButton("Resultados"); btnNewButton_1.setBounds(351, 455, 102, 21); btnNewButton_1.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e) { // codigo para abrir el otro formulario Resultados abrir = new Resultados(); //llamo al segundo formulario y el texto donde quiero pasar el dato y luego coloco el dato creado " xd" Resultados.PrimerC.setText(xd.getText()); Resultados.SegundoC.setText(xdd.getText()); Resultados.bl.setText(xddd.getText()); Resultados.nl.setText(xdddd.getText()); abrir.setVisible(true); this.setVisible(false); dispose();
  • 14. } private void setVisible(boolean b) { } }); contentPane.add(btnNewButton_1); xd = new JTextField(); xd.setBackground(new Color(255, 255, 255)); xd.setVisible(false); xd.setEnabled(false); xd.setEditable(false); xd.setBounds(115, 476, 96, 19); contentPane.add(xd); xd.setColumns(10); xdd = new JTextField(); xdd.setBounds(115, 505, 96, 19); xdd.setVisible(false); contentPane.add(xdd); xdd.setColumns(10); xddd = new JTextField(); xddd.setEnabled(false); xddd.setVisible(false); xddd.setEditable(false); xddd.setBounds(226, 476, 96, 19); contentPane.add(xddd); xddd.setColumns(10); xdddd = new JTextField();
  • 15. xdddd.setBounds(221, 505, 96, 19); xdddd.setVisible(false); contentPane.add(xdddd); xdddd.setColumns(10); } public JTextField getTextField() { return xd; } }
  • 16. f.) ____ _______ f.) __________________ MSc. Víctor Zapata ESTUDIANTE DOCENTE