-
Notifications
You must be signed in to change notification settings - Fork 0
/
Formulario38.java
54 lines (40 loc) · 1.19 KB
/
Formulario38.java
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
import javax.swing.*;
import javax.swing.event.*;
public class Formulario38 extends JFrame implements ChangeListener{
private JCheckBox check1, check2, check3;
public Formulario38(){
setLayout(null);
check1 = new JCheckBox("Inglés");
check1.setBounds (10,10,150,30);
check1.addChangeListener(this);
add(check1);
check2 = new JCheckBox("Francés");
check2.setBounds (10,50,150,30);
check2.addChangeListener(this);
add(check2);
check3 = new JCheckBox("Alemán");
check3.setBounds (10,90,150,30);
check3.addChangeListener(this);
add(check3);
}
public void stateChanged(ChangeEvent e){
String cad="";
if (check1.isSelected() == true){
cad = cad + "Inglés-";
}
if (check2.isSelected() == true){
cad = cad + "Francés-";
}
if (check3.isSelected() == true){
cad = cad + "Alemán-";
}
setTitle(cad);
}
public static void main (String args[]){
Formulario38 formulario1 = new Formulario38();
formulario1.setBounds(0,0,350,200);
formulario1.setVisible(true);
formulario1.setLocationRelativeTo(null);
formulario1.setResizable(true);
}
}