-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path14.java
More file actions
72 lines (72 loc) · 1.69 KB
/
14.java
File metadata and controls
72 lines (72 loc) · 1.69 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
//Question no.14
import java.awt.*;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;
public class Main{
public Main()
{
Frame frame = new Frame("Applet program");
Label l1 = new Label("Applet");
l1.setBounds(10,30,50,30);
Label l2 = new Label("Name :");
l2.setBounds(10,60,50,30);
TextField t1 = new TextField();
t1.setBounds(70,60,80,30);
Label l3 = new Label("Address :");
l3.setBounds(10,100,65,30);
TextField t2 = new TextField();
t2.setBounds(80,100,80,30);
Label l4 = new Label("Birthday :");
l4.setBounds(10,140,70,30);
TextField t3 = new TextField();
t3.setBounds(80,140,80,30);
Label l5 = new Label("Gender :");
l5.setBounds(10,180,65,30);
Choice c1 = new Choice();
c1.setBounds(70,180,100,30);
c1.add("Male");
c1.add("Female");
c1.add("Prefer not to say");
Label l6 = new Label("Job :");
l6.setBounds(10,220,30,30);
CheckboxGroup cbg = new CheckboxGroup();
Checkbox cb1 = new Checkbox("Student",cbg,false);
cb1.setBounds(40,220,80,30);
Checkbox cb2 = new Checkbox("Teacher",cbg,false);
cb2.setBounds(120,220,100,30);
Button b1 = new Button("Register");
b1.setBounds(0,260,85,30);
Button b2 = new Button("Exit");
b2.setBounds(86,260,85,30);
Label l7 = new Label("Applet started.");
l7.setBounds(10,550,100,30);
frame.add(l1);
frame.add(l2);
frame.add(t1);
frame.add(l3);
frame.add(t2);
frame.add(l4);
frame.add(t3);
frame.add(l5);
frame.add(c1);
frame.add(l6);
frame.add(cb1);
frame.add(cb2);
frame.add(b1);
frame.add(b2);
frame.add(l7);
frame.setSize(800,600);
frame.setLayout(null);
frame.setVisible(true);
frame.addWindowListener(new WindowAdapter() {
@Override
public void windowClosing(WindowEvent e) {
frame.dispose();
}
});
}
public static void main (String[] args)
{
Main obj1 = new Main();
}
}