-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMTECH1.java
441 lines (394 loc) · 12.4 KB
/
MTECH1.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
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Font;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.ItemEvent;
import java.awt.event.ItemListener;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.Statement;
import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JFrame;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.JScrollPane;
import javax.swing.JTextField;
public class MTECH1 extends JPanel
{//SEM 1
JTextField combo1_1;
JTextField combo1_2;
JTextField combo1_3;
JTextField combo1_4;
JTextField combo1_5;
JTextField combo1_6;
JLabel label1;
JLabel label1_1;
JLabel label1_2;
JLabel lab1_1;
JLabel lab1_2;
JLabel lab1_3;
JLabel lab1_4;
JLabel lab1_5;
JLabel lab1_6;
//SEM2
JTextField combo2_1;
JTextField combo2_2;
JTextField combo2_3;
JTextField combo2_4;
JTextField combo2_5;
JTextField combo2_6;
JLabel label2;
JLabel label2_1;
JLabel label2_2;
JLabel lab2_1;
JLabel lab2_2;
JLabel lab2_3;
JLabel lab2_4;
JLabel lab2_5;
JLabel lab2_6;
//SEM 3
JTextField combo3_1;
JTextField combo3_2;
JTextField combo3_3;
JTextField combo3_4;
JLabel label3;
JLabel label3_1;
JLabel label3_2;
JLabel lab3_1;
JLabel lab3_2;
JLabel lab3_3;
JLabel lab3_4;
//SEM 4
JTextField combo4_1;
JLabel label4;
JLabel label4_1;
JLabel lab4_1;
JScrollPane jsp;
JButton submit;
public MTECH1()
{//semester1
setLayout(null);
//JFrame f=new JFrame;
JButton submit=new JButton();
submit.setText("SUBMIT");
submit.setBounds(120,610,700,40);
add(submit);
setPreferredSize(new Dimension(1500,1500));
setBackground(new Color(75,163,230));
String a1[]={" ","RP EC-501","RT EC-501","RTI EC-501"};
String a2[]={" ","RP EC-502","RT EC-502","RTI EC-502"};
String a3[]={" ","RP EC-503","RT EC-503","RTI EC-503"};
String a4[]={" ","RP EC-504","RT EC-504","RTI EC-504"};
String a5[]={" ","RP EC-505","RT EC-505","RTI EC-505"};
String a6[]={" ","RP EC-506","RT EC-506","RTI EC-506"};
JLabel label1=new JLabel();
JLabel label1_1=new JLabel();
JLabel label1_2=new JLabel();
JLabel lab1_1=new JLabel();
JLabel lab1_2=new JLabel();
JLabel lab1_3=new JLabel();
JLabel lab1_4=new JLabel();
JLabel lab1_5=new JLabel();
JLabel lab1_6=new JLabel();
combo1_1 = new JTextField();
combo1_2 = new JTextField();
combo1_3 = new JTextField();
combo1_4 = new JTextField();
combo1_5 = new JTextField();
combo1_6 = new JTextField();
label1.setText("Semester-1:");
label1_1.setText("Theory");
label1_2.setText("Labs");
lab1_1.setText("AME");
lab1_2.setText("ESD");
lab1_3.setText("DCN");
lab1_4.setText("ACS");
lab1_5.setText("NNFL");
lab1_6.setText("LAB");
combo1_1.setBounds(20,70,70,20);
combo1_2.setBounds(120,70,70,20);
combo1_3.setBounds(220,70,70,20);
combo1_4.setBounds(320,70,70,20);
combo1_5.setBounds(420,70,70,20);
combo1_6.setBounds(520,70,70,20);
label1.setBounds(20,15,70,20);
label1_1.setBounds(20,30,70,20);
label1_2.setBounds(520,30,70,20);
lab1_1.setBounds(20,50,70,20);
lab1_2.setBounds(120,50,70,20);
lab1_3.setBounds(220,50,70,20);
lab1_4.setBounds(320,50,70,20);
lab1_5.setBounds(420,50,70,20);
lab1_6.setBounds(520,50,70,20);
add(combo1_1);
add(combo1_2);
add(combo1_3);
add(combo1_4);
add(combo1_5);
add(combo1_6);
add(label1);
add(label1_1);
add(label1_2);
add(lab1_1);
add(lab1_2);
add(lab1_3);
add(lab1_4);
add(lab1_5);
add(lab1_6);
//SEM 2
String b1[]={" ","RP EC-507","RT EC-507","RTI EC-507"};
String b2[]={" ","RP EC-508","RT EC-508","RTI EC-508"};
String b3[]={" ","RP EC-509","RT EC-509","RTI EC-509"};
String b4[]={" ","RP EC-510","RT EC-510","RTI EC-510","-------","VLSI DESIGN","RP EC-511","RT EC-511","RTI EC-511","-------","RECS","RP EC-512","RT EC-512","RTI EC-512"};
String b5[]={" ","RP EC-513","RT EC-513","RTI EC-513","-------","PP","RP EC-514","RT EC-514","RTI EC-514","-------","PSDI","RP EC-515","RT EC-515","RTI EC-515"};
String b6[]={" ","RP EC-516","RT EC-516","RTI EC-516"};
JLabel label2=new JLabel();
JLabel label2_1=new JLabel();
JLabel label2_2=new JLabel();
JLabel lab2_1=new JLabel();
JLabel lab2_2=new JLabel();
JLabel lab2_3=new JLabel();
JLabel lab2_4=new JLabel();
JLabel lab2_5=new JLabel();
JLabel lab2_6=new JLabel();
combo2_1 = new JTextField();
combo2_2 = new JTextField();
combo2_3 = new JTextField();
combo2_4 = new JTextField();
combo2_5 = new JTextField();
combo2_6 = new JTextField();
label2.setText("Semester-2:");
label2_1.setText("Theory");
label2_2.setText("Labs");
lab2_1.setText("OCS");
lab2_2.setText("DSIP");
lab2_3.setText("ITC");
lab2_4.setText("AMES");
lab2_5.setText("MCS");
lab2_6.setText("LAB-II");
combo2_1.setBounds(20,210,70,20);
combo2_2.setBounds(120,210,70,20);
combo2_3.setBounds(220,210,70,20);
combo2_4.setBounds(320,210,70,20);
combo2_5.setBounds(420,210,70,20);
combo2_6.setBounds(520,210,70,20);
label2.setBounds(20,155,70,20);
label2_1.setBounds(20,170,70,20);
label2_2.setBounds(520,170,70,20);
lab2_1.setBounds(20,190,70,20);
lab2_2.setBounds(120,190,70,20);
lab2_3.setBounds(220,190,70,20);
lab2_4.setBounds(320,190,70,20);
lab2_5.setBounds(420,190,70,20);
lab2_6.setBounds(520,190,70,20);
add(combo2_1);
add(combo2_2);
add(combo2_3);
add(combo2_4);
add(combo2_5);
add(combo2_6);
add(label2);
add(label2_1);
add(label2_2);
add(lab2_1);
add(lab2_2);
add(lab2_3);
add(lab2_4);
add(lab2_5);
add(lab2_6);
//SEM 3
String c1[]={" ","RP EC-517","RT EC-517","RTI EC-517","-------","MTT","RP EC-518","RT EC-518","RTI EC-518","-------","DET","RP EC-519","RT EC-519","RTI EC-519","-------","WMC","RP EC-520","RT EC-520","RTI EC-520"};
String c2[]={" ","RP EC-521","RT EC-521","RTI EC-521","-------","IIP","RP EC-522","RT EC-522","RTI EC-522","-------","RFMAT","RP EC-523","RT EC-523","RTI EC-523","-------","CT","RP EC-524","RT EC-524","RTI EC-524"};
String c3[]={" ","RP EC-580","RT EC-580","RTI EC-580"};
String c4[]={" ","RP EC-590","RT EC-590","RTI EC-590"};
JLabel label3=new JLabel();
JLabel label3_1=new JLabel();
JLabel lab3_1=new JLabel();
JLabel lab3_2=new JLabel();
JLabel lab3_3=new JLabel();
JLabel lab3_4=new JLabel();
combo3_1 = new JTextField();
combo3_2 = new JTextField();
combo3_3 = new JTextField();
combo3_4 = new JTextField();
label3.setText("Semester-3:");
label3_1.setText("Theory");
lab3_1.setText("MSCS");
lab3_2.setText("MT");
lab3_3.setText("PROJECT");
lab3_4.setText("SEMINAR");
combo3_1.setBounds(20,350,70,20);
combo3_2.setBounds(120,350,70,20);
combo3_3.setBounds(220,350,70,20);
combo3_4.setBounds(320,350,70,20);
label3.setBounds(20,295,70,20);
label3_1.setBounds(20,310,70,20);
lab3_1.setBounds(20,330,70,20);
lab3_2.setBounds(120,330,70,20);
lab3_3.setBounds(220,330,70,20);
lab3_4.setBounds(320,330,70,20);
add(combo3_1);
add(combo3_2);
add(combo3_3);
add(combo3_4);
add(label3);
add(label3_1);
add(lab3_1);
add(lab3_2);
add(lab3_3);
add(lab3_4);
//SEM 4
String d[]={" ","RP EC-500","RT EC-500","RTI EC-500"};
JLabel label4=new JLabel();
JLabel label4_1=new JLabel();
JLabel lab4_1=new JLabel();
combo4_1 = new JTextField();
label4.setText("Semester-4:");
lab4_1.setText("Dissertion");
combo4_1.setBounds(20,490,70,20);
label4.setBounds(20,435,70,20);
lab4_1.setBounds(20,470,70,20);
add(combo4_1);
add(label4);
add(lab4_1);
submit.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e)
{
submit_actionPerformed(e);
}
});
}
void submit_actionPerformed(java.awt.event.ActionEvent evt)
{
System.out.println("sucess...");
nextpage p=null;
print r=new print();
Object o = p.sem.getSelectedItem();
System.out.println(o);
if(o.equals("1"))
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:office","","");
Statement stmt=con.createStatement();
String query="update project set "+
" s_name = '"+p.sname.getText()+
"' , uni_roll = '"+p.uni_rol.getText()+
"' , f_name = '" + p.f_name.getText()+
"' , branch = '"+p.branch.getSelectedItem()+
"' , batch = '"+p.batch.getSelectedItem()+
"' , sem = '"+p.sem.getSelectedItem()+
"' , s1 = '"+combo1_1.getText()+
"' , s2 = '"+combo1_2.getText()+
"' , s3 = '"+combo1_3.getText()+
"' , s4 = '"+combo1_4.getText()+
"' , s5 = '"+combo1_5.getText()+
"' , l1 = '"+combo1_6.getText()+
"' where c_roll='"+p.clsrol.getText()+"'";
stmt.executeUpdate(query);
con.close();
System.out.println("record enter sucessfully");
}
catch(Exception ex)
{
System.out.println("Error - "+ex);
}
remove(this);
setVisible(true);
}
if(o.equals("2"))
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:office","","");
Statement stmt=con.createStatement();
String query="update project set "+
" s_name = '"+p.sname.getText()+
"' , uni_roll = '"+p.uni_rol.getText()+
"' , f_name = '" + p.f_name.getText()+
"' , branch = '"+p.branch.getSelectedItem()+
"' , batch = '"+p.batch.getSelectedItem()+
"' , sem = '"+p.sem.getSelectedItem()+
"' , s1 = '"+combo2_1.getText()+
"' , s2 = '"+combo2_2.getText()+
"' , s3 = '"+combo2_3.getText()+
"' , s4 = '"+combo2_4.getText()+
"' , s5 = '"+combo2_5.getText()+
"' , l1 = '"+combo2_6.getText()+
"' where c_roll='"+p.clsrol.getText()+"'";
stmt.executeUpdate(query);
con.close();
System.out.println("record enter sucessfully");
}
catch(Exception ex)
{
System.out.println("Error - "+ex);
}
remove(this);
setVisible(true);
}
if(o.equals("3"))
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:office","","");
Statement stmt=con.createStatement();
String query="update project set "+
" s_name = '"+p.sname.getText()+
"' , uni_roll = '"+p.uni_rol.getText()+
"' , f_name = '" + p.f_name.getText()+
"' , branch = '"+p.branch.getSelectedItem()+
"' , batch = '"+p.batch.getSelectedItem()+
"' , sem = '"+p.sem.getSelectedItem()+
"' , s1 = '"+combo3_1.getText()+
"' , s2 = '"+combo3_2.getText()+
"' , s3 = '"+combo3_3.getText()+
"' , s4 = '"+combo3_4.getText()+
"' where c_roll='"+p.clsrol.getText()+"'";
stmt.executeUpdate(query);
con.close();
System.out.println("record enter sucessfully");
}
catch(Exception ex)
{
System.out.println("Error - "+ex);
}
remove(this);
setVisible(true);
}
if(o.equals("4"))
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:office","","");
Statement stmt=con.createStatement();
String query="update project set "+
" s_name = '"+p.sname.getText()+
"' , uni_roll = '"+p.uni_rol.getText()+
"' , f_name = '" + p.f_name.getText()+
"' , branch = '"+p.branch.getSelectedItem()+
"' , batch = '"+p.batch.getSelectedItem()+
"' , sem = '"+p.sem.getSelectedItem()+
"' , s1 = '"+combo4_1.getText()+
"' where c_roll='"+p.clsrol.getText()+"'";
stmt.executeUpdate(query);
con.close();
System.out.println("record enter sucessfully");
}
catch(Exception ex)
{
System.out.println("Error - "+ex);
}
remove(this);
setVisible(true);
}
}
}