-
Notifications
You must be signed in to change notification settings - Fork 0
/
MTECH.java
685 lines (552 loc) · 17.7 KB
/
MTECH.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
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
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 MTECH extends JPanel
{//SEM 1
JComboBox combo1_1;
JComboBox combo1_2;
JComboBox combo1_3;
JComboBox combo1_4;
JComboBox combo1_5;
JComboBox 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
JComboBox combo2_1;
JComboBox combo2_2;
JComboBox combo2_3;
JComboBox combo2_4;
JComboBox combo2_5;
JComboBox 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
JComboBox combo3_1;
JComboBox combo3_2;
JComboBox combo3_3;
JComboBox combo3_4;
JLabel label3;
JLabel label3_1;
JLabel label3_2;
JLabel lab3_1;
JLabel lab3_2;
JLabel lab3_3;
JLabel lab3_4;
//SEM 4
JComboBox combo4_1;
JLabel label4;
JLabel label4_1;
JLabel lab4_1;
JScrollPane jsp;
JButton submit;
public MTECH()
{//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 JComboBox(a1);
combo1_2 = new JComboBox(a2);
combo1_3 = new JComboBox(a3);
combo1_4 = new JComboBox(a4);
combo1_5 = new JComboBox(a5);
combo1_6 = new JComboBox(a6);
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 JComboBox(b1);
combo2_2 = new JComboBox(b2);
combo2_3 = new JComboBox(b3);
combo2_4 = new JComboBox(b4);
combo2_5 = new JComboBox(b5);
combo2_6 = new JComboBox(b6);
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 JComboBox(c1);
combo3_2 = new JComboBox(c2);
combo3_3 = new JComboBox(c3);
combo3_4 = new JComboBox(c4);
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 JComboBox(d);
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","","");
PreparedStatement st=con.prepareStatement("insert into project values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
st.setString(1,p.clsrol.getText());
st.setString(2,p.sname.getText());
st.setString(3,p.uni_rol.getText());
st.setString(4,p.f_name.getText());
st.setString(5,(String) p.branch.getSelectedItem());
st.setString(6,(String) p.batch.getSelectedItem());
st.setString(7,(String) p.sem.getSelectedItem());
st.setString(8,(String) combo1_1.getSelectedItem());
st.setString(9,(String) combo1_2.getSelectedItem());
st.setString(10,(String) combo1_3.getSelectedItem());
st.setString(11,(String) combo1_4.getSelectedItem());
st.setString(12,null);
st.setString(13,null);
st.setString(14,null);
st.setString(15,null);
st.setString(16,(String) combo1_5.getSelectedItem());
st.setString(17,(String) combo1_6.getSelectedItem());
st.setString(18,null);
st.setString(19,null);
st.setString(20,null);
st.setString(21,null);
// st.setString(6,s6.getText());
st.executeUpdate();
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","","");
PreparedStatement st=con.prepareStatement("insert into project values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
st.setString(1,p.clsrol.getText());
st.setString(2,p.sname.getText());
st.setString(3,p.uni_rol.getText());
st.setString(4,p.f_name.getText());
st.setString(5,(String) p.branch.getSelectedItem());
st.setString(6,(String) p.batch.getSelectedItem());
st.setString(7,(String) p.sem.getSelectedItem());
st.setString(8,(String) combo2_1.getSelectedItem());
st.setString(9,(String) combo2_2.getSelectedItem());
st.setString(10,(String) combo2_3.getSelectedItem());
st.setString(11,(String) combo2_4.getSelectedItem());
st.setString(12,(String) combo2_5.getSelectedItem());
st.setString(13,null);
st.setString(14,null);
st.setString(15,null);
st.setString(16,(String) combo2_6.getSelectedItem());
st.setString(17,null);
st.setString(18,null);
st.setString(19,null);
st.setString(20,null);
st.setString(21,null);
//st.setString(6,s6.getText());
st.executeUpdate();
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","","");
PreparedStatement st=con.prepareStatement("insert into project values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
st.setString(1,p.clsrol.getText());
st.setString(2,p.sname.getText());
st.setString(3,p.uni_rol.getText());
st.setString(4,p.f_name.getText());
st.setString(5,(String) p.branch.getSelectedItem());
st.setString(6,(String) p.batch.getSelectedItem());
st.setString(7,(String) p.sem.getSelectedItem());
st.setString(8,(String) combo3_1.getSelectedItem());
st.setString(9,(String) combo3_2.getSelectedItem());
st.setString(10,(String) combo3_3.getSelectedItem());
st.setString(11,(String) combo3_4.getSelectedItem());
st.setString(12,null);
st.setString(13,null);
st.setString(14,null);
st.setString(15,null);
st.setString(16,null);
st.setString(17,null);
st.setString(18,null);
st.setString(19,null);
st.setString(20,null);
st.setString(21,null);
//st.setString(6,s6.getText());
st.executeUpdate();
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","","");
PreparedStatement st=con.prepareStatement("insert into project values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
st.setString(1,p.clsrol.getText());
st.setString(2,p.sname.getText());
st.setString(3,p.uni_rol.getText());
st.setString(4,p.f_name.getText());
st.setString(5,(String) p.branch.getSelectedItem());
st.setString(6,(String) p.batch.getSelectedItem());
st.setString(7,(String) p.sem.getSelectedItem());
st.setString(8,(String) combo4_1.getSelectedItem());
st.setString(9,null);
st.setString(10,null);
st.setString(11,null);
st.setString(12,null);
st.setString(13,null);
st.setString(14,null);
st.setString(15,null);
st.setString(16,null);
st.setString(17,null);
st.setString(18,null);
st.setString(19,null);
st.setString(20,null);
st.setString(21,null);
st.executeUpdate();
con.close();
System.out.println("record enter sucessfully");
}
catch(Exception ex)
{
System.out.println("Error - "+ex);
}
remove(this);
setVisible(true);
}
if(o.equals("5"))
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:office","","");
PreparedStatement st=con.prepareStatement("insert into project values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
st.setString(1,p.clsrol.getText());
st.setString(2,p.sname.getText());
st.setString(3,p.uni_rol.getText());
st.setString(4,p.f_name.getText());
st.setString(5,(String) p.branch.getSelectedItem());
st.setString(6,(String) p.batch.getSelectedItem());
st.setString(7,(String) p.sem.getSelectedItem());
st.setString(8,(String) combo2_1.getSelectedItem());
st.setString(9,(String) combo2_2.getSelectedItem());
st.setString(10,(String) combo2_3.getSelectedItem());
st.setString(11,(String) combo2_4.getSelectedItem());
st.setString(12,null);
st.setString(13,null);
st.setString(14,null);
st.setString(15,null);
st.setString(16,(String) combo2_5.getSelectedItem());
st.setString(17,(String) combo2_6.getSelectedItem());
st.setString(18,null);
st.setString(19,null);
st.setString(20,null);
st.setString(21,null);
//st.setString(6,s6.getText());
st.executeUpdate();
con.close();
System.out.println("record enter sucessfully");
}
catch(Exception ex)
{
System.out.println("Error - "+ex);
}
remove(this);
setVisible(true);
}
if(o.equals("6"))
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:office","","");
PreparedStatement st=con.prepareStatement("insert into project values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
st.setString(1,p.clsrol.getText());
st.setString(2,p.sname.getText());
st.setString(3,p.uni_rol.getText());
st.setString(4,p.f_name.getText());
st.setString(5,(String) p.branch.getSelectedItem());
st.setString(6,(String) p.batch.getSelectedItem());
st.setString(7,(String) p.sem.getSelectedItem());
st.setString(8,(String) combo2_1.getSelectedItem());
st.setString(9,(String) combo2_2.getSelectedItem());
st.setString(10,(String) combo2_3.getSelectedItem());
st.setString(11,(String) combo2_4.getSelectedItem());
st.setString(12,null);
st.setString(13,null);
st.setString(14,null);
st.setString(15,null);
st.setString(16,(String) combo2_5.getSelectedItem());
st.setString(17,(String) combo2_6.getSelectedItem());
st.setString(18,null);
st.setString(19,null);
st.setString(20,null);
st.setString(21,null);
//st.setString(6,s6.getText());
st.executeUpdate();
con.close();
System.out.println("record enter sucessfully");
}
catch(Exception ex)
{
System.out.println("Error - "+ex);
}
remove(this);
setVisible(true);
}
if(o.equals("7")||o.equals("8"))
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection con=DriverManager.getConnection("jdbc:odbc:office","","");
PreparedStatement st=con.prepareStatement("insert into project values(?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)");
st.setString(1,p.clsrol.getText());
st.setString(2,p.sname.getText());
st.setString(3,p.uni_rol.getText());
st.setString(4,p.f_name.getText());
st.setString(5,(String) p.branch.getSelectedItem());
st.setString(6,(String) p.batch.getSelectedItem());
st.setString(7,(String) p.sem.getSelectedItem());
st.setString(8,(String) combo2_1.getSelectedItem());
st.setString(9,(String) combo2_2.getSelectedItem());
st.setString(10,(String) combo2_3.getSelectedItem());
st.setString(11,(String) combo2_4.getSelectedItem());
st.setString(12,null);
st.setString(13,null);
st.setString(14,null);
st.setString(15,null);
st.setString(16,(String) combo2_5.getSelectedItem());
st.setString(17,(String) combo2_6.getSelectedItem());
st.setString(18,null);
st.setString(19,null);
st.setString(20,null);
st.setString(21,null);
//st.setString(6,s6.getText());
st.executeUpdate();
con.close();
System.out.println("record enter sucessfully");
}
catch(Exception ex)
{
System.out.println("Error - "+ex);
}
remove(this);
setVisible(true);
}
}
}