-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFormularioFlow.java
More file actions
144 lines (100 loc) · 2.99 KB
/
FormularioFlow.java
File metadata and controls
144 lines (100 loc) · 2.99 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
import java.awt.Color;
import java.awt.FlowLayout;
import java.awt.Font;
import java.awt.LayoutManager;
import javax.swing.JButton;
import javax.swing.JCheckBox;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JTextArea;
import javax.swing.JTextField;
public class FormularioFlow extends JFrame{
FormularioFlow(){
//Creacion del jframe
JFrame frame= new JFrame();
frame.setSize(460,180);
frame.setResizable(false);
//frame.setResizable(false);
frame.setTitle("Formulario");
frame.setVisible(true);
//Esto pasa si se agrega al frame directamente.
// JButton boton= new JButton();
// boton.setSize(10,10);
// frame.add(boton);
//Creacion del panel
JPanel panel1= new JPanel();
//panel1.setBackground(Color.YELLOW);
panel1.setLayout(new FlowLayout(FlowLayout.CENTER));
//panel1.setLayout(new FlowLayout(0,0,70));
//////////////////////////////// x,y
//Se añade al frame el panel
frame.add(panel1);
JLabel eti1= new JLabel("Nombre: ");
eti1.setSize(100,100);
//eti1.setForeground(Color.RED);
panel1.add(eti1);
JTextField txt1= new JTextField(30);
txt1.setSize(100,100);
//txt1.setBounds(0,0,50,60);
panel1.add(txt1);
JLabel eti2= new JLabel("Apellido Paterno:");
eti1.setSize(100,100);
panel1.add(eti2);
JTextField txt2= new JTextField(30);
txt2.setSize(100,100);
panel1.add(txt2);
JLabel eti3= new JLabel("Apellido Materno:");
eti1.setSize(100,100);
panel1.add(eti3);
JTextField txt3= new JTextField(30);
txt3.setSize(100,100);
panel1.add(txt3);
JLabel eti4= new JLabel("Dirección: ");
eti4.setSize(100,100);
panel1.add(eti4);
JTextField txt4= new JTextField(30);
txt4.setSize(100,100);
panel1.add(txt4);
JLabel eti5= new JLabel("Estado: ");
eti5.setSize(100,100);
panel1.add(eti5);
JComboBox com5= new JComboBox();
com5.addItem("Elige estado");
com5.addItem("Soltero");
com5.addItem("Casado");
com5.addItem("Viudo");
com5.setSize(100,100);
panel1.add(com5);
JLabel eti6= new JLabel("Sexo: ");
eti6.setSize(100,100);
panel1.add(eti6);
JLabel m= new JLabel("Mujer");
m.setSize(100,100);
panel1.add(m);
JCheckBox txt6= new JCheckBox();
txt6.setSize(100,100);
panel1.add(txt6);
JLabel eti7= new JLabel("Hombre");
eti7.setSize(100,100);
panel1.add(eti7);
JCheckBox txt7= new JCheckBox();
txt7.setSize(100,100);
panel1.add(txt7);
//
// JLabel sugerencia= new JLabel("Escriba su sugerencia: ");
// sugerencia.setSize(100,100);
// panel1.add(sugerencia);
JTextArea txtare= new JTextArea();
txtare.setSize(100,100);
txtare.setVisible(true);
panel1.add(txtare);
JButton bot= new JButton("ACEPTAR");
bot.setSize(100,100);
panel1.add(bot);
}
public static void main(String[]args){
new FormularioFlow();
}
}