forked from sarthakd999/Hacktoberfest2021-2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAishaChanna.txt
110 lines (80 loc) · 3.02 KB
/
AishaChanna.txt
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
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class GUI6 {
JFrame frame=new JFrame("Register Form");
Container con=frame.getContentPane();
JLabel lhead, lusername, lpassword, lgender, lcity, lemail;
JTextField tusername, temail;
JPasswordField pass;
JRadioButton r1, r2;
ButtonGroup gender=new ButtonGroup();
JComboBox city;
JCheckBox term;
JButton register, reset;
GUI6(){
frame.setBounds(350, 90, 750, 500);
frame.setVisible(true);
frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
con.setLayout(null);
con.setBackground(Color.LIGHT_GRAY);
Font f=new Font("Times New Roman", Font.BOLD, 20);
lhead=new JLabel("Registeration Form");
lhead.setBounds(250, 5, 400, 30);
lhead.setFont(f);
con.add(lhead);
lusername=new JLabel("Username");
lusername.setBounds(50, 50, 60, 30);
con.add(lusername);
lpassword=new JLabel("Password");
lpassword.setBounds(50, 100, 60, 30);
con.add(lpassword);
lgender=new JLabel("Gender");
lgender.setBounds(50, 150, 60, 30);
con.add(lgender);
lcity=new JLabel("City");
lcity.setBounds(50, 200, 60, 30);
con.add(lcity);
lemail=new JLabel("Email");
lemail.setBounds(50, 250, 60, 30);
con.add(lemail);
tusername=new JTextField();
tusername.setBounds(130, 53, 180, 20);
con.add(tusername);
pass=new JPasswordField();
pass.setBounds(130, 103, 180, 20);
con.add(pass);
r1= new JRadioButton("Male");
r1.setBounds(130, 153, 80, 30);
r1.setBackground(Color.LIGHT_GRAY);
con.add(r1);
r2=new JRadioButton("Female");
r2.setBounds(230, 153, 80, 30);
r2.setBackground(Color.LIGHT_GRAY);
con.add(r2);
gender.add(r1);
gender.add(r2);
String citylist[]={"karachi","hyderabad","Abbottabad","Dadu","Faisalabad","Sargodha"};
city = new JComboBox(citylist);
city.setBounds(130, 203, 95, 25);
con.add(city);
temail = new JTextField();
temail.setBounds(130, 253, 180, 20);
con.add(temail);
term = new JCheckBox("I accept terms and conditions");
term.setBounds(65, 290, 200, 20);
term.setBackground(Color.GRAY);
con.add(term);
register = new JButton("Register");
register.setBounds(100, 330, 85, 25);
con.add(register);
reset = new JButton("Reset");
reset.setBounds(195, 330, 85, 25);
con.add(reset);
}
}
class Main{
public static void main(String []args) {
GUI6 r=new GUI6();
}
}