-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSignup2.java
237 lines (197 loc) · 8.05 KB
/
Signup2.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
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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
/*
* Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
* Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
*/
package bankmanagement;
import java.awt.Color;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JRadioButton;
import javax.swing.JTextField;
/**
*
* @author cotad
*/
public class Signup2 extends JFrame implements ActionListener {
JComboBox comboBox,comboBox2,comboBox3,comboBox4,comboBox5;
JTextField textPan,textAadhar;
JRadioButton r1,r2, e1,e2;
JButton next;
String formno;
Signup2(String formno){
super("APPLICATION FORM");
ImageIcon i1 = new ImageIcon(ClassLoader.getSystemResource("iconn/bank.png"));
java.awt.Image i2 = i1.getImage().getScaledInstance(100,100,java.awt.Image.SCALE_DEFAULT);
ImageIcon i3 = new ImageIcon(i2);
JLabel image = new JLabel(i3);
image.setBounds(150,5,100,100);
add(image);
this.formno = formno;
JLabel l1 = new JLabel("Page 2 :-");
l1.setFont(new Font("Raleway", Font.BOLD,22));
l1.setBounds(300,30,600,40);
add(l1);
JLabel l2 = new JLabel("Additonal Details");
l2.setFont(new Font("Raleway", Font.BOLD,22));
l2.setBounds(300,60,600,40);
add(l2);
JLabel l3 = new JLabel("Religion :");
l3.setFont(new Font("Raleway", Font.BOLD,18));
l3.setBounds(100,120,100,30);
add(l3);
String religion[] = {"Hindu","Muslim","Sikh", "Christian", "Other"};
comboBox = new JComboBox(religion);
comboBox.setBackground(new Color(252,208,76));
comboBox.setFont(new Font("Raleway",Font.BOLD,14));
comboBox.setBounds(350,120,320,30);
add(comboBox);
JLabel l4 = new JLabel("Category : ");
l4.setFont(new Font("Raleway", Font.BOLD,18));
l4.setBounds(100,170,100,30);
add(l4);
String Category [] = {"General","OBC","SC", "ST", "Other"};
comboBox2 = new JComboBox(Category);
comboBox2.setBackground(new Color(252,208,76));
comboBox2.setFont(new Font("Raleway",Font.BOLD,14));
comboBox2.setBounds(350,170,320,30);
add(comboBox2);
JLabel l5 = new JLabel("Income : ");
l5.setFont(new Font("Raleway", Font.BOLD,18));
l5.setBounds(100,220,100,30);
add(l5);
String income [] = {"Null","<1,50,000","<2,50,000", "5,00,000", "Uptp 10,00,000","Above 10,00,000"};
comboBox3 = new JComboBox(income);
comboBox3.setBackground(new Color(252,208,76));
comboBox3.setFont(new Font("Raleway",Font.BOLD,14));
comboBox3.setBounds(350,220,320,30);
add(comboBox3);
JLabel l6 = new JLabel("Educational : ");
l6.setFont(new Font("Raleway", Font.BOLD,18));
l6.setBounds(100,270,150,30);
add(l6);
String educational [] = {"Non-Graduate","Graduate","Post-Graduate", "Doctrate", "Others"};
comboBox4 = new JComboBox(educational);
comboBox4.setBackground(new Color(252,208,76));
comboBox4.setFont(new Font("Raleway",Font.BOLD,14));
comboBox4.setBounds(350,270,320,30);
add(comboBox4);
JLabel l7 = new JLabel("Occupation : ");
l7.setFont(new Font("Raleway", Font.BOLD,18));
l7.setBounds(100,340,150,30);
add(l7);
String Occupation [] = {"Salaried","Self-Employed","Business", "Student", "Retired", "Other"};
comboBox5 = new JComboBox(Occupation);
comboBox5.setBackground(new Color(252,208,76));
comboBox5.setFont(new Font("Raleway",Font.BOLD,14));
comboBox5.setBounds(350,340,320,30);
add(comboBox5);
JLabel l8 = new JLabel("PAN Number : ");
l8.setFont(new Font("Raleway", Font.BOLD,18));
l8.setBounds(100,390,150,30);
add(l8);
textPan = new JTextField();
textPan.setFont(new Font("Raleway", Font.BOLD,18));
textPan.setBounds(350,390,320,30);
add(textPan);
JLabel l9 = new JLabel("Aadhar Number : ");
l9.setFont(new Font("Raleway", Font.BOLD,18));
l9.setBounds(100,440,180,30);
add(l9);
textAadhar = new JTextField();
textAadhar.setFont(new Font("Raleway", Font.BOLD,18));
textAadhar.setBounds(350,440,320,30);
add(textAadhar);
JLabel l10 = new JLabel("Senior Citizen : ");
l10.setFont(new Font("Raleway", Font.BOLD,18));
l10.setBounds(100,490,180,30);
add(l10);
r1 = new JRadioButton("Yes");
r1.setFont(new Font("Raleway", Font.BOLD,14));
r1.setBackground(new Color(252,208,76));
r1.setBounds(350,490,100,30);
add(r1);
r2 = new JRadioButton("No");
r2.setFont(new Font("Raleway", Font.BOLD,14));
r2.setBackground(new Color(252,208,76));
r2.setBounds(460,490,100,30);
add(r2);
JLabel l11 = new JLabel("Existing Account : ");
l11.setFont(new Font("Raleway", Font.BOLD,18));
l11.setBounds(100,540,180,30);
add(l11);
e1 = new JRadioButton("Yes");
e1.setFont(new Font("Raleway", Font.BOLD,14));
e1.setBackground(new Color(252,208,76));
e1.setBounds(350,540,100,30);
add(e1);
e2 = new JRadioButton("No");
e2.setFont(new Font("Raleway", Font.BOLD,14));
e2.setBackground(new Color(252,208,76));
e2.setBounds(460,540,100,30);
add(e2);
JLabel l12 = new JLabel("Form No : ");
l12.setFont(new Font("Raleway", Font.BOLD,14));
l12.setBounds(700,10,100,30);
add(l12);
JLabel l13 = new JLabel(formno);
l13.setFont(new Font("Raleway", Font.BOLD,14));
l13.setBounds(760,10,60,30);
add(l13);
next = new JButton("Next");
next.setFont(new Font("Raleway",Font.BOLD,14));
next.setBackground(Color.WHITE);
next.setForeground(Color.BLACK);
next.setBounds(570,640,100,30);
next.addActionListener(this);
add(next);
setLayout(null);
setSize(850,750);
setLocation(450,80);
getContentPane().setBackground(new Color(252, 208, 76));
setVisible(true);
}
@Override
public void actionPerformed(ActionEvent e) {
String rel = (String) comboBox.getSelectedItem();
String cate = (String) comboBox2.getSelectedItem();
String inc = (String) comboBox3.getSelectedItem();
String edu = (String) comboBox4.getSelectedItem();
String occ = (String) comboBox5.getSelectedItem();
String pan = textPan.getText();
String addhar = textAadhar.getText();
String scitizen = " ";
if ((r1.isSelected())){
scitizen = "Yes";
} else if (r2.isSelected()) {
scitizen ="No";
}
String eAccount = " ";
if ((r1.isSelected())){
eAccount = "Yes";
} else if (r2.isSelected()) {
eAccount ="No";
}
try{
if (textPan.getText().equals("") || textAadhar.getText().equals("")){
javax.swing.JOptionPane.showMessageDialog(null,"Fill all the fields");
}else {
connn c = new connn();
String q = "insert into Signuptwo values('"+formno+"', '"+rel+"', '"+cate+"','"+inc+"','"+edu+"','"+occ+"','"+pan+"','"+addhar+"','"+scitizen+"','"+eAccount+"')";
c.statement.executeUpdate(q);
new Signup3(formno);
setVisible(false);
}
}catch (Exception E){
E.printStackTrace();
}
}
public static void main(String[] args) {
new Signup2("");
}
}