-
Notifications
You must be signed in to change notification settings - Fork 0
/
LMS.java
2018 lines (1824 loc) · 78.4 KB
/
LMS.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
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import java.awt.EventQueue;
import java.awt.BorderLayout;
import java.awt.CardLayout;
import java.awt.FlowLayout;
import javax.swing.*;
import java.awt.event.ActionListener;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.util.HashMap;
import java.util.logging.SimpleFormatter;
import java.awt.event.ActionEvent;
import java.awt.Color;
import java.awt.Component;
import java.awt.Dimension;
import javax.swing.GroupLayout.Alignment;
import javax.swing.LayoutStyle.ComponentPlacement;
import javax.swing.table.TableColumnModel;
import java.awt.Font;
import java.awt.Button;
import java.awt.Rectangle;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.awt.event.ItemListener;
import java.awt.event.ItemEvent;
public class LMS {
private DataBase db;
private JFrame frmLms;
private JLayeredPane lpMain;
private JPanel pnlLogin;
private JPanel pnlWorkingArea;
private JLayeredPane lpFeatures;
private JPanel pnlTimetable;
private JPanel pnlConflicts;
private JPanel pnlProfile;
private JPanel pnlStudTeachTimetable;
private JPanel pnlClassTimetable;
private JPanel pnlClassList;
private JPanel pnlStudentList;
private JPanel pnlSlavesInfo;
private JPanel pnlRemoveSlave;
private JPanel pnlSetCalssSlave;
private JPanel pnlPeopleInfo;
private JPanel pnlAddClass;
private JPanel pnlRemoveClass;
private JPanel pnlSetTeacher;
private JPanel pnlRemoveMember;
private JPanel pnlDefault;
private JPanel pnlFeatureButtons;
private JButton btnTimetable;
private JButton btnConflicts;
private JButton btnProfile;
private JButton btnStudTeachTimetable;
private JButton btnClassTimetable;
private JButton btnClassesList;
private JButton btnStudentList;
private JButton btnSlaveInfo;
private JButton btnRemoveSlave;
private JButton btnSetClassSlave;
private JButton btnPeopleInfo;
private JButton btnAddClass;
private JButton btnRemoveClass;
private JButton btnSetTeacher;
private JButton btnRemoveMember;
private JButton btnStudentProfle;
private JButton btnCreateCabinet;
private JButton btnExit;
private JTextField fldLogin;
private JPasswordField fldPassword;
private JLabel lblError;
private JTextField fldName;
private JButton btnShow;
private JLabel lblInput_error;
private JTextField fldCabinetNumber;
private JComboBox cbBuilding;
private JButton btnShow_tt;
private JTable table;
private JTextField fldClass_ID;
private JLabel lblNewLabel_1;
private JLabel lblNewLabel_2;
private JTextField fldLogin_1;
private JTextField fldClassID_1;
private JButton btnRemove_1;
private JTextField fldLogin_3;
private JTextField fldClassID_3;
private JLabel lblNewLabel_4;
private JLabel lblNewLabel_5;
private JTextField fldClassName;
private JTextField fldClass;
private JTextField fldClassID;
private JTextField fldEmail;
private JTextField fldClassID_2;
private JTextField fldStudent;
private JTextField fldTeacher;
private JTextField fldCabinet;
private JTextField fldCabinet_9;
private JTextField fldPassport;
private JTextField fldMial;
private JTextField fldFIO;
private JTextField fldMail_Tutor;
private JLabel lblerror;
private JLabel lblerror_1;
private JLabel lblerror_2;
private JLabel lblerror_5;
private JLabel lblerror_23;
private JLabel lblerror_8;
private String login = "";
private int type = 0;
private JScrollPane spStudentTeacherTimetable;
private JScrollPane spClassTimetable;
private JTextField fldName_3;
private JLabel lblNewLabel_10;
private JTextField fldLogin_9;
private JLabel lblNewLabel_12;
private JLabel lblNewLabel_13;
private JScrollPane spStudentList;
private JTextField fldDate;
private JTextField fldTime;
private JComboBox cbBuilding_1;
private JLabel lblerror_16;
private JLabel lblNewLabel_18;
private JTextField fldTeacher_1;
private JLabel lblerror_22;
private JLabel lblerror_21;
private JComboBox cbStudTeach;
private JButton btnGetPasswords;
private JComboBox cbStudTeach_1;
private JComboBox cbSort;
private JCheckBox cbSupervisor;
private JComboBox cbSelectTS;
private JLabel lblerror_40;
private JLabel lblNO;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
LMS window = new LMS();
window.frmLms.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the application.
*/
public LMS() {
db = new DataBase();
initialize();
}
public void switchPanels(JLayeredPane layer, JPanel panel) {
layer.removeAll();
layer.add(panel);
layer.repaint();
layer.revalidate();
}
public void exit() {
login = "";
}
public void addFeatures(int type) {
// TODO äîáàâèòü êíîïîê è ðàñïîëîæåíèå
JButton[] SupervisorFeatureButtons = { btnTimetable, btnConflicts, btnProfile, btnStudTeachTimetable,
btnClassTimetable, btnClassesList, btnStudentList, btnRemoveMember, btnGetPasswords, btnPeopleInfo,
btnStudentProfle, btnCreateCabinet, btnAddClass, btnRemoveClass, btnSetClassSlave, btnRemoveSlave,
btnSetTeacher, btnExit };
JButton[] StudentFeatureButtons = { btnTimetable, btnConflicts, btnProfile, btnStudTeachTimetable,
btnClassTimetable, btnClassesList, btnStudentList, btnExit };
JButton[] TeacherFeatureButtons = { btnTimetable, btnConflicts, btnProfile, btnStudTeachTimetable,
btnClassTimetable, btnClassesList, btnStudentList, btnSlaveInfo, btnRemoveSlave, btnSetClassSlave,
btnExit };
String[] StudentTexts = { "Ìî¸ ðàñïèñàíèå", "Êîíôëèêòû â ðàñïèñàíèè", "Ïðîôèëü", "Ðàñïèñàíèå ñîòðóíèêà",
"Ðàñïèñàíèå êàáèíåòà", "Ñïèñîê çàíÿòèé", "Ñîòðóäíèêè íà çàíÿòèè", "Âûéòè è ñèñòåìû" };
String[] TeacherTexts = { "Ìî¸ ðàñïèñàíèå", "Êîíôëèêòû â ðàñïèñàíèè", "Ïðîôèëü", "Ðàñïèñàíèå ñîòðóíèêà",
"Ðàñïèñàíèå êàáèíåòà", "Ñïèñîê çàíÿòèé", "Ñîòðóäíèêè íà çàíÿòèè", "Èíôîðìàöèÿ î ïîäîïå÷íîì",
"Óäàëèòü ñ çàíÿòèÿ", "Íàçíà÷èò çàíÿòèå", "Âûéòè è ñèñòåìû" };
String[] SuperviserTexts = { "Ìî¸ ðàñïèñàíèå", "Êîíôëèêòû â ðàñïèñàíèè", "Ïðîôèëü", "Ðàñïèñàíèå ñîòðóíèêà",
"Ðàñïèñàíèå êàáèíåòà", "Ñïèñîê çàíÿòèé", "Ñîòðóäíèêè íà çàíÿòèè", "Óäàëèòü îáúåêò",
"Ïàðîëè ïîëüçîâàòåëåé", "Èíôîðìàöèÿ î ïîëüçîâàòåëÿõ", "Ðåäàêòîð ïîëüçîâàòåëåé", "Ðåäàêòîð êàáèíåòîâ",
"Ñîçäàòü çàíÿòèå", "Óäàëèòü çàíÿòèå", "Íàçíà÷èòü çàíÿòèå ó÷àùåìóñÿ", "Óäàëèòü ó÷àùåãîñÿ ñ çàíÿòèÿ",
"Íàçíà÷èòü ïðåïîäàâàòåëÿ", "Âûéòè è ñèñòåìû" };
pnlFeatureButtons.setBounds(0, 0, frmLms.getWidth(), frmLms.getHeight() / 3);
pnlFeatureButtons.setBackground(Color.DARK_GRAY);
lpFeatures.setBounds(0, frmLms.getHeight() / 3, frmLms.getWidth(), 2 * frmLms.getHeight() / 3);
for (Component comp : lpFeatures.getComponents()) {
comp.setBounds(0, 0, lpFeatures.getWidth(), lpFeatures.getHeight());
comp.setBackground(Color.LIGHT_GRAY);
}
JButton[] features;
String[] texts;
int w_offset = 5;
int h_offset = 5;
int width = pnlFeatureButtons.getWidth() / 4 - 2 * w_offset;
int height = pnlFeatureButtons.getHeight() / 5 - 2 * h_offset;
pnlFeatureButtons.removeAll();
// type = 3;
if (type == 1) {
features = StudentFeatureButtons;
texts = StudentTexts;
} else if (type == 2) {
features = TeacherFeatureButtons;
texts = TeacherTexts;
} else {
features = SupervisorFeatureButtons;
texts = SuperviserTexts;
}
for (int i = 0; i < features.length; i++) {
features[i].setBounds(w_offset + i % 4 * (width + w_offset), h_offset + i / 4 * (height + h_offset), width,
height);
features[i].setText(texts[i]);
features[i].setForeground(Color.BLACK);
features[i].setFont(new Font("Tahoma", Font.BOLD, 11));
pnlFeatureButtons.add(features[i]);
}
pnlFeatureButtons.repaint();
pnlFeatureButtons.revalidate();
}
public void fill_table(JTable table, String request) {
}
/**
* Initialize the contents of the frame.
*/
private void initialize() {
frmLms = new JFrame();
frmLms.setBounds(new Rectangle(0, 0, 900, 550));
frmLms.setResizable(false);
frmLms.setTitle("LMS");
frmLms.setBounds(100, 100, 900, 550);
frmLms.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
frmLms.getContentPane().setLayout(new BorderLayout(0, 0));
lpMain = new JLayeredPane();
frmLms.getContentPane().add(lpMain, BorderLayout.CENTER);
lpMain.setLayout(new CardLayout(0, 0));
pnlLogin = new JPanel();
lpMain.add(pnlLogin, "name_189362071419400");
JLabel lblLogin = new JLabel("\u041B\u043E\u0433\u0438\u043D:");
lblLogin.setFont(new Font("Tahoma", Font.BOLD, 11));
lblLogin.setHorizontalAlignment(SwingConstants.LEFT);
JLabel lblPassword = new JLabel("\u041F\u0430\u0440\u043E\u043B\u044C:");
lblPassword.setFont(new Font("Tahoma", Font.BOLD, 11));
lblPassword.setHorizontalAlignment(SwingConstants.LEFT);
fldLogin = new JTextField();
fldLogin.setColumns(10);
fldPassword = new JPasswordField();
fldPassword.setColumns(10);
JButton btnEnter = new JButton("\u0412\u0445\u043E\u0434");
btnEnter.setFont(new Font("Tahoma", Font.BOLD, 11));
btnEnter.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// U0_login_and_password_check(IN email VARCHAR(45), IN password_ CHAR(8), OUT
// result_status TINYINT)
// user :"[email protected]"
// password : 53713069
String name = fldLogin.getText();
String password = new String(fldPassword.getPassword());
String procedure = "U0_login_and_password_check";
String[] names = { "email", "password_" };
String[] types = { "String", "String" };
String[] values = { name, password };
try {
ResultSet response = db.request(procedure, names, types, values);
int code = db.getStatus();
if (code == 0)
lblError.setVisible(true);
else {
login = name;
type = code;
lblError.setVisible(false);
fldLogin.setText("");
fldPassword.setText("");
addFeatures(code);
switchPanels(lpMain, pnlWorkingArea);
switchPanels(lpFeatures, pnlDefault);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
});
lblError = new JLabel(
"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043B\u043E\u0433\u0438\u043D \u0438\u043B\u0438 \u043F\u0430\u0440\u043E\u043B\u044C!");
lblError.setHorizontalAlignment(SwingConstants.CENTER);
lblError.setFont(new Font("Tahoma", Font.BOLD, 11));
lblError.setForeground(Color.RED);
lblError.setVisible(false);
JLabel lblNewLabel_6 = new JLabel("\u0410\u0432\u0442\u043E\u0440\u0438\u0437\u0430\u0446\u0438\u044F:");
lblNewLabel_6.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_6.setFont(new Font("Tahoma", Font.BOLD, 20));
GroupLayout gl_pnlLogin = new GroupLayout(pnlLogin);
gl_pnlLogin.setHorizontalGroup(gl_pnlLogin.createParallelGroup(Alignment.TRAILING).addGroup(gl_pnlLogin
.createSequentialGroup().addGap(311)
.addGroup(gl_pnlLogin.createParallelGroup(Alignment.LEADING)
.addComponent(lblNewLabel_6, GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
.addComponent(btnEnter, GroupLayout.DEFAULT_SIZE, 295, Short.MAX_VALUE)
.addGroup(gl_pnlLogin.createSequentialGroup()
.addComponent(lblLogin, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
.addGap(18)
.addComponent(fldLogin, GroupLayout.PREFERRED_SIZE, 174, GroupLayout.PREFERRED_SIZE))
.addGroup(gl_pnlLogin.createSequentialGroup()
.addComponent(lblPassword, GroupLayout.PREFERRED_SIZE, 103, GroupLayout.PREFERRED_SIZE)
.addGap(18).addComponent(fldPassword, GroupLayout.PREFERRED_SIZE, 174,
GroupLayout.PREFERRED_SIZE)))
.addGap(290))
.addGroup(gl_pnlLogin.createSequentialGroup().addContainerGap(361, Short.MAX_VALUE)
.addComponent(lblError, GroupLayout.PREFERRED_SIZE, 198, GroupLayout.PREFERRED_SIZE)
.addGap(337)));
gl_pnlLogin.setVerticalGroup(gl_pnlLogin.createParallelGroup(Alignment.LEADING)
.addGroup(gl_pnlLogin.createSequentialGroup().addGap(132).addComponent(lblNewLabel_6).addGap(36)
.addGroup(gl_pnlLogin.createParallelGroup(Alignment.BASELINE)
.addComponent(fldLogin, GroupLayout.PREFERRED_SIZE, 31, GroupLayout.PREFERRED_SIZE)
.addComponent(lblLogin, GroupLayout.PREFERRED_SIZE, 17, GroupLayout.PREFERRED_SIZE))
.addGap(45)
.addGroup(
gl_pnlLogin.createParallelGroup(Alignment.BASELINE)
.addComponent(fldPassword, GroupLayout.PREFERRED_SIZE, 30,
GroupLayout.PREFERRED_SIZE)
.addComponent(lblPassword))
.addGap(28)
.addComponent(lblError, GroupLayout.DEFAULT_SIZE, GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGap(18).addComponent(btnEnter, GroupLayout.PREFERRED_SIZE, 34, GroupLayout.PREFERRED_SIZE)
.addGap(130)));
pnlLogin.setLayout(gl_pnlLogin);
pnlWorkingArea = new JPanel();
pnlWorkingArea.setLayout(null);
lpMain.add(pnlWorkingArea, "name_189405765305100");
lpFeatures = new JLayeredPane();
lpFeatures.setBounds(10, 241, 876, 271);
pnlWorkingArea.add(lpFeatures);
lpFeatures.setLayout(new CardLayout(0, 0));
pnlTimetable = new JPanel();
pnlTimetable.setLayout(null);
lpFeatures.add(pnlTimetable, "name_189919841249800");
JScrollPane spTimetable = new JScrollPane();
spTimetable.setBounds(80, 25, 700, 200);
pnlTimetable.add(spTimetable);
table = new JTable();
spTimetable.setViewportView(table);
lblNO = new JLabel(
"\u0417\u0430\u043D\u044F\u0442\u0438\u044F \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442!");
lblNO.setHorizontalAlignment(SwingConstants.CENTER);
lblNO.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNO.setBounds(260, 120, 379, 25);
pnlTimetable.add(lblNO);
pnlConflicts = new JPanel();
pnlConflicts.setLayout(null);
lpFeatures.add(pnlConflicts, "name_189919855419100");
JScrollPane spConflicts = new JScrollPane();
spConflicts.setBounds(80, 25, 700, 200);
pnlConflicts.add(spConflicts);
JLabel lblNewLabel_28 = new JLabel(
"\u041A\u043E\u043D\u0444\u043B\u0438\u043A\u0442\u044B \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044E\u0442!");
lblNewLabel_28.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_28.setHorizontalAlignment(SwingConstants.CENTER);
lblNewLabel_28.setForeground(Color.GREEN);
lblNewLabel_28.setBounds(280, 120, 291, 25);
pnlConflicts.add(lblNewLabel_28);
pnlProfile = new JPanel();
pnlProfile.setLayout(null);
lpFeatures.add(pnlProfile, "name_189919868237200");
JScrollPane spProfile = new JScrollPane();
spProfile.setBounds(169, 31, 550, 197);
pnlProfile.add(spProfile);
pnlStudTeachTimetable = new JPanel();
pnlStudTeachTimetable.setLayout(null);
lpFeatures.add(pnlStudTeachTimetable, "name_189919878071100");
fldName = new JTextField();
fldName.setHorizontalAlignment(SwingConstants.CENTER);
fldName.setFont(new Font("Tahoma", Font.BOLD, 15));
fldName.setColumns(10);
fldName.setBounds(324, 31, 292, 25);
pnlStudTeachTimetable.add(fldName);
btnShow = new JButton("\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C");
btnShow.setFont(new Font("Tahoma", Font.BOLD, 15));
btnShow.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// TODO òàáëèöà
// U1_get_personal_timetable(IN email CHAR(45))
String name = fldName.getText();
String procedure = "U1_get_personal_timetable";
String[] names = { "email" };
String[] types = { "String" };
String[] values = { name };
try {
ResultSet response = db.request(procedure, names, types, values);
int code = db.getStatus();
if (code == 0) {
lblInput_error.setVisible(true);
spStudentTeacherTimetable.setVisible(false);
} else {
lblInput_error.setVisible(false);
JTable table = fill_table(response);
table.setEnabled(false);
spStudentTeacherTimetable.setViewportView(table);
spStudentTeacherTimetable.setVisible(true);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
spStudentTeacherTimetable.repaint();
}
});
btnShow.setBounds(639, 31, 118, 25);
pnlStudTeachTimetable.add(btnShow);
lblInput_error = new JLabel(
"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D!");
lblInput_error.setHorizontalAlignment(SwingConstants.CENTER);
lblInput_error.setFont(new Font("Tahoma", Font.BOLD, 15));
lblInput_error.setForeground(Color.RED);
lblInput_error.setBounds(334, 67, 262, 25);
lblInput_error.setVisible(false);
pnlStudTeachTimetable.add(lblInput_error);
JLabel lblInputName = new JLabel(
"\u041B\u043E\u0433\u0438\u043D \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F:");
lblInputName.setFont(new Font("Tahoma", Font.BOLD, 15));
lblInputName.setBounds(125, 31, 189, 25);
pnlStudTeachTimetable.add(lblInputName);
spStudentTeacherTimetable = new JScrollPane();
spStudentTeacherTimetable.setBounds(94, 103, 700, 150);
pnlStudTeachTimetable.add(spStudentTeacherTimetable);
pnlClassTimetable = new JPanel();
pnlClassTimetable.setLayout(null);
lpFeatures.add(pnlClassTimetable, "name_189919888166300");
fldCabinetNumber = new JTextField();
fldCabinetNumber.setFont(new Font("Tahoma", Font.BOLD, 15));
fldCabinetNumber.setHorizontalAlignment(SwingConstants.CENTER);
fldCabinetNumber.setColumns(10);
fldCabinetNumber.setBounds(303, 27, 176, 25);
pnlClassTimetable.add(fldCabinetNumber);
cbBuilding = new JComboBox();
cbBuilding.setFont(new Font("Tahoma", Font.BOLD, 15));
cbBuilding.setModel(
new DefaultComboBoxModel(new String[] { "\u041A\u043E\u0440\u043F\u0443\u0441", "\u0410", "\u0411" }));
cbBuilding.setSelectedIndex(0);
cbBuilding.setBounds(489, 27, 87, 25);
pnlClassTimetable.add(cbBuilding);
btnShow_tt = new JButton("\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C");
btnShow_tt.setFont(new Font("Tahoma", Font.BOLD, 15));
btnShow_tt.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// TODO ãðàôèêà
// U2_get_room_timetable(IN room_building VARCHAR(1), IN room_number VARCHAR(5))
String number = fldCabinetNumber.getText();
String corpus = (String) cbBuilding.getSelectedItem();
if (corpus == "Êîðïóñ") {
lblerror.setText("Âûáåðåòå êîðïóñ!");
lblerror.setVisible(true);
} else {
String procedure = "U2_get_room_timetable";
String[] names = { "room_building", "room_number" };
String[] types = { "String", "String" };
String[] values = { corpus, number };
try {
ResultSet response = db.request(procedure, names, types, values);
int code = db.getStatus();
if (code == 0) {
lblerror.setText("Ðàñïèñàíèå çàíÿòèé äëÿ êàáèíåòà íå íàéäåíî!");
lblerror.setForeground(Color.RED);
lblerror.setVisible(true);
spClassTimetable.setVisible(false);
} else {
lblerror.setVisible(false);
JTable table = fill_table(response);
table.setEnabled(false);
spClassTimetable.setViewportView(table);
spClassTimetable.setVisible(true);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
}
});
btnShow_tt.setBounds(606, 27, 115, 25);
pnlClassTimetable.add(btnShow_tt);
lblerror = new JLabel("\u041A\u043B\u0430\u0441\u0441 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D!");
lblerror.setHorizontalAlignment(SwingConstants.CENTER);
lblerror.setFont(new Font("Tahoma", Font.BOLD, 15));
lblerror.setForeground(Color.RED);
lblerror.setBounds(169, 63, 459, 25);
pnlClassTimetable.add(lblerror);
spClassTimetable = new JScrollPane();
spClassTimetable.setBounds(157, 99, 392, 141);
pnlClassTimetable.add(spClassTimetable);
JLabel lblNewLabel_14 = new JLabel(
"\u041D\u043E\u043C\u0435\u0440 \u043A\u0430\u0431\u0438\u043D\u0435\u0442\u0430:");
lblNewLabel_14.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_14.setBounds(146, 27, 159, 25);
pnlClassTimetable.add(lblNewLabel_14);
pnlClassList = new JPanel();
pnlClassList.setLayout(null);
lpFeatures.add(pnlClassList, "name_189919897580700");
JScrollPane spClassList = new JScrollPane();
spClassList.setBounds(80, 30, 700, 200);
pnlClassList.add(spClassList);
pnlStudentList = new JPanel();
lpFeatures.add(pnlStudentList, "name_204217712864500");
pnlStudentList.setLayout(null);
fldClass_ID = new JTextField();
fldClass_ID.setHorizontalAlignment(SwingConstants.CENTER);
fldClass_ID.setFont(new Font("Tahoma", Font.BOLD, 15));
fldClass_ID.setBounds(298, 30, 172, 25);
pnlStudentList.add(fldClass_ID);
fldClass_ID.setColumns(10);
JButton btnShow_st = new JButton("\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C");
btnShow_st.setFont(new Font("Tahoma", Font.BOLD, 15));
btnShow_st.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// TODO ïîëîæåíèå òàáëèöû
// U4_get_class_tutors_info(IN class_id INT, OUT result_status TINYINT)
// U7_get_class_students_info(IN class_id INT, OUT result_status TINYINT)
String id = fldClass_ID.getText();
String who = (String) cbStudTeach.getSelectedItem();
String procedure;
if (who.equals("Ñòóäåíòû"))
procedure = "U7_get_class_students_info";
else
procedure = "U4_get_class_tutors_info";
String[] names = { "class_id" };
String[] types = { "Int" };
String[] values = { id };
try {
ResultSet response = db.request(procedure, names, types, values);
int code = db.getStatus();
if (code == 0) {
lblerror_1.setVisible(true);
spStudentList.setVisible(false);
} else {
lblerror_1.setVisible(false);
JTable table = fill_table(response);
table.setEnabled(false);
spStudentList.setViewportView(table);
spStudentList.setVisible(true);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
});
btnShow_st.setBounds(665, 30, 114, 25);
pnlStudentList.add(btnShow_st);
JLabel lblNewLabel = new JLabel(
"\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0437\u0430\u043D\u044F\u0442\u0438\u044F:");
lblNewLabel.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel.setBounds(74, 30, 218, 25);
pnlStudentList.add(lblNewLabel);
lblerror_1 = new JLabel(
"\u0417\u0430\u043D\u044F\u0442\u0438\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E!");
lblerror_1.setHorizontalAlignment(SwingConstants.CENTER);
lblerror_1.setFont(new Font("Tahoma", Font.BOLD, 15));
lblerror_1.setForeground(Color.RED);
lblerror_1.setBounds(266, 77, 246, 19);
pnlStudentList.add(lblerror_1);
spStudentList = new JScrollPane();
spStudentList.setBounds(74, 107, 705, 150);
pnlStudentList.add(spStudentList);
cbStudTeach = new JComboBox();
cbStudTeach.setModel(new DefaultComboBoxModel(new String[] { "\u0421\u0442\u0443\u0434\u0435\u043D\u0442\u044B",
"\u041F\u0440\u0435\u043F\u043E\u0434\u0430\u0432\u0430\u0442\u0435\u043B\u0438" }));
cbStudTeach.setSelectedIndex(0);
cbStudTeach.setFont(new Font("Tahoma", Font.BOLD, 15));
cbStudTeach.setBounds(492, 30, 163, 25);
pnlStudentList.add(cbStudTeach);
pnlSlavesInfo = new JPanel();
lpFeatures.add(pnlSlavesInfo, "name_205535522498700");
pnlSlavesInfo.setLayout(null);
JScrollPane spSlavesInfo = new JScrollPane();
spSlavesInfo.setBounds(172, 102, 510, 150);
pnlSlavesInfo.add(spSlavesInfo);
JButton btnShow_3 = new JButton("\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C");
btnShow_3.setFont(new Font("Tahoma", Font.BOLD, 15));
btnShow_3.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// TODO table
// T1_get_info_on_related_students(IN email VARCHAR(45))
String name = fldName_3.getText();
String procedure = "T1_get_info_on_related_students";
String[] names = { "email" };
String[] types = { "String" };
String[] values = { name };
try {
ResultSet response = db.request(procedure, names, types, values);
int code = db.getStatus();
if (code == 0) {
lblInput_error.setVisible(true);
} else {
lblInput_error.setVisible(false);
JTable table = fill_profile(response);
table.setEnabled(false);
spSlavesInfo.setViewportView(table);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
});
btnShow_3.setBounds(569, 30, 113, 25);
pnlSlavesInfo.add(btnShow_3);
fldName_3 = new JTextField();
fldName_3.setHorizontalAlignment(SwingConstants.CENTER);
fldName_3.setFont(new Font("Tahoma", Font.BOLD, 15));
fldName_3.setBounds(349, 30, 201, 25);
pnlSlavesInfo.add(fldName_3);
fldName_3.setColumns(10);
JLabel lblNewLabel_8 = new JLabel(
"\u041B\u043E\u0433\u0438\u043D \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F:");
lblNewLabel_8.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_8.setBounds(172, 30, 201, 25);
pnlSlavesInfo.add(lblNewLabel_8);
JLabel lblerror_15 = new JLabel(
"\u041F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044C \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D!");
lblerror_15.setHorizontalAlignment(SwingConstants.CENTER);
lblerror_15.setFont(new Font("Tahoma", Font.BOLD, 15));
lblerror_15.setBounds(325, 66, 249, 25);
pnlSlavesInfo.add(lblerror_15);
pnlRemoveSlave = new JPanel();
lpFeatures.add(pnlRemoveSlave, "name_205708106849200");
pnlRemoveSlave.setLayout(null);
lblNewLabel_1 = new JLabel(
"\u041B\u043E\u0433\u0438\u043D \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F:");
lblNewLabel_1.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_1.setBounds(117, 109, 193, 25);
pnlRemoveSlave.add(lblNewLabel_1);
lblNewLabel_2 = new JLabel(
"\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0437\u0430\u043D\u044F\u0442\u0438\u044F:");
lblNewLabel_2.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_2.setBounds(117, 156, 242, 25);
pnlRemoveSlave.add(lblNewLabel_2);
fldLogin_1 = new JTextField();
fldLogin_1.setHorizontalAlignment(SwingConstants.CENTER);
fldLogin_1.setFont(new Font("Tahoma", Font.BOLD, 15));
fldLogin_1.setBounds(349, 109, 236, 25);
pnlRemoveSlave.add(fldLogin_1);
fldLogin_1.setColumns(10);
fldClassID_1 = new JTextField();
fldClassID_1.setHorizontalAlignment(SwingConstants.CENTER);
fldClassID_1.setFont(new Font("Tahoma", Font.BOLD, 15));
fldClassID_1.setBounds(349, 156, 236, 25);
pnlRemoveSlave.add(fldClassID_1);
fldClassID_1.setColumns(10);
btnRemove_1 = new JButton("\u0423\u0434\u0430\u043B\u0438\u0442\u044C");
btnRemove_1.setFont(new Font("Tahoma", Font.BOLD, 15));
btnRemove_1.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// T3_drop_related_student_from_class(IN students_email VARCHAR(45), IN
// tutors_email VARCHAR(45), IN class_id INT, OUT result_status TINYINT)
// A14_drop_student_from_class(IN email VARCHAR(45), IN class_id INT, OUT
// result_status TINYINT)
String name = fldLogin_1.getText();
String id = fldClassID_1.getText();
if (type == 2) {
String procedure = "T3_drop_related_student_from_class";
String[] names = { "students_email", "tutors_email", "class_id" };
String[] types = { "String", "String", "Int" };
String[] values = { name, login, id };
ResultSet response = db.request(procedure, names, types, values);
} else {
String procedure = "A14_drop_student_from_class";
String[] names = { "email", "class_id" };
String[] types = { "String", "Int" };
String[] values = { name, id };
ResultSet response = db.request(procedure, names, types, values);
}
try {
int code = db.getStatus();
if (code == 0) {
lblerror_2.setText("Ñîâïàäåíèé íå íàéäåíî!");
lblerror_2.setForeground(Color.RED);
lblerror_2.setVisible(true);
} else {
lblerror_2.setText("Óñïåøíî!");
lblerror_2.setForeground(Color.GREEN);
lblerror_2.setVisible(true);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
});
btnRemove_1.setBounds(620, 131, 126, 25);
pnlRemoveSlave.add(btnRemove_1);
lblerror_2 = new JLabel(
"\u0421\u043E\u0432\u0430\u0434\u0435\u043D\u0438\u0439 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E!");
lblerror_2.setHorizontalAlignment(SwingConstants.CENTER);
lblerror_2.setFont(new Font("Tahoma", Font.BOLD, 15));
lblerror_2.setForeground(Color.RED);
lblerror_2.setBounds(203, 211, 497, 25);
pnlRemoveSlave.add(lblerror_2);
pnlSetCalssSlave = new JPanel();
lpFeatures.add(pnlSetCalssSlave, "name_205851538972100");
pnlSetCalssSlave.setLayout(null);
fldLogin_3 = new JTextField();
fldLogin_3.setFont(new Font("Tahoma", Font.BOLD, 15));
fldLogin_3.setHorizontalAlignment(SwingConstants.CENTER);
fldLogin_3.setBounds(438, 79, 212, 25);
pnlSetCalssSlave.add(fldLogin_3);
fldLogin_3.setColumns(10);
fldClassID_3 = new JTextField();
fldClassID_3.setFont(new Font("Tahoma", Font.BOLD, 15));
fldClassID_3.setHorizontalAlignment(SwingConstants.CENTER);
fldClassID_3.setBounds(438, 115, 212, 25);
pnlSetCalssSlave.add(fldClassID_3);
fldClassID_3.setColumns(10);
lblNewLabel_4 = new JLabel(
"\u041B\u043E\u0433\u0438\u043D \u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u0435\u043B\u044F:");
lblNewLabel_4.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_4.setBounds(234, 77, 189, 25);
pnlSetCalssSlave.add(lblNewLabel_4);
lblNewLabel_5 = new JLabel(
"\u0418\u0434\u0435\u043D\u0442\u0438\u0444\u0438\u043A\u0430\u0442\u043E\u0440 \u0437\u0430\u043D\u044F\u0442\u0438\u044F:");
lblNewLabel_5.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_5.setBounds(234, 113, 229, 25);
pnlSetCalssSlave.add(lblNewLabel_5);
JComboBox cbPrior = new JComboBox();
cbPrior.setFont(new Font("Tahoma", Font.BOLD, 15));
cbPrior.setModel(new DefaultComboBoxModel(new String[] {
"\u041F\u0440\u0438\u043E\u0440\u0438\u0442\u0435\u0442", "\u041D\u0438\u0437\u043A\u0438\u0439",
"\u0412\u044B\u0441\u043E\u043A\u0438\u0439", "\u0421\u0440\u0435\u0434\u043D\u0438\u0439" }));
cbPrior.setSelectedIndex(0);
cbPrior.setBounds(438, 153, 212, 25);
pnlSetCalssSlave.add(cbPrior);
JLabel lblerror_3 = new JLabel(
"\u0417\u0430\u043D\u044F\u0442\u0438\u0435 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E");
lblerror_3.setHorizontalAlignment(SwingConstants.CENTER);
lblerror_3.setForeground(Color.RED);
lblerror_3.setFont(new Font("Tahoma", Font.BOLD, 15));
lblerror_3.setBounds(316, 205, 249, 25);
pnlSetCalssSlave.add(lblerror_3);
JButton btnSet = new JButton("\u041D\u0430\u0437\u043D\u0430\u0447\u0438\u0442\u044C");
btnSet.setFont(new Font("Verdana", Font.BOLD, 15));
btnSet.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// T2_set_related_student_to_class(IN students_email VARCHAR(45), IN
// tutors_email VARCHAR(45), IN class_id INT, IN priority VARCHAR(7), OUT
// result_status TINYINT)
// A13_set_student_to_class (IN email VARCHAR(45), IN class_id INT, IN priority
// VARCHAR(7), OUT result_status TINYINT)
String name = fldLogin_3.getText();
String id = fldClassID_3.getText();
String priority = (String) cbPrior.getSelectedItem();
if (priority.equals("Ïðèîðèòåò")) {
lblerror_3.setText("Âûáåðåòå ïðèîðèòåò!");
lblerror_3.setForeground(Color.RED);
lblerror_3.setVisible(true);
} else {
if (type == 2) {
String procedure = "T2_set_related_student_to_class";
String[] names = { "students_email", "tutors_email", "class_id", "priority" };
String[] types = { "String", "String", "Int", "String" };
String[] values = { name, login, id, priority };
ResultSet response = db.request(procedure, names, types, values);
} else {
String procedure = "A13_set_student_to_class";
String[] names = { "email", "class_id", "priority" };
String[] types = { "String", "Int", "String" };
String[] values = { name, id, priority };
ResultSet response = db.request(procedure, names, types, values);
}
try {
int code = db.getStatus();
if (code == 0) {
lblerror_3.setText("Ñîâïàäåíèé íå íàéäåíî!");
lblerror_3.setForeground(Color.RED);
lblerror_3.setVisible(true);
} else {
lblerror_3.setText("Óñïåøíî!");
lblerror_3.setForeground(Color.GREEN);
lblerror_3.setVisible(true);
}
} catch (SQLException e1) {
e1.printStackTrace();
}
}
}
});
btnSet.setBounds(234, 153, 150, 25);
pnlSetCalssSlave.add(btnSet);
pnlDefault = new JPanel();
lpFeatures.add(pnlDefault, "name_208114001379900");
pnlPeopleInfo = new JPanel();
lpFeatures.add(pnlPeopleInfo, "name_209663407575100");
pnlPeopleInfo.setLayout(null);
JScrollPane spPeopleInfo = new JScrollPane();
spPeopleInfo.setBounds(153, 110, 563, 150);
pnlPeopleInfo.add(spPeopleInfo);
cbStudTeach_1 = new JComboBox();
cbStudTeach_1.addItemListener(new ItemListener() {
public void itemStateChanged(ItemEvent e) {
String state = (String) cbStudTeach_1.getSelectedItem();
cbSort.removeAllItems();
cbSort.addItem("ÔÈÎ");
cbSort.addItem("Êîëè÷åñòâî çàíÿòèé");
if (state.equals("Ïðåïîäàâàòåëè")) {
cbSort.addItem("Êëè÷åñòâî ïîäîïå÷íûõ");
cbSort.addItem("Êîëè÷åñòâî êàáèíåòîâ");
}
}
});
cbStudTeach_1.setFont(new Font("Tahoma", Font.BOLD, 15));
cbStudTeach_1
.setModel(new DefaultComboBoxModel(new String[] { "\u0421\u0442\u0443\u0434\u0435\u043D\u0442\u044B ",
"\u041F\u0440\u0435\u043F\u043E\u0434\u0430\u0432\u0430\u0442\u0435\u043B\u0438" }));
cbStudTeach_1.setSelectedIndex(0);
cbStudTeach_1.setBounds(324, 11, 218, 25);
pnlPeopleInfo.add(cbStudTeach_1);
cbSort = new JComboBox();
cbSort.setFont(new Font("Tahoma", Font.BOLD, 15));
cbSort.setModel(new DefaultComboBoxModel(new String[] { "\u0424\u0418\u041E",
"\u041A\u043E\u043B\u0438\u0447\u0435\u0441\u0442\u0432\u043E \u0437\u0430\u043D\u044F\u0442\u0438\u0439" }));
cbSort.setSelectedIndex(0);
cbSort.setBounds(324, 47, 218, 25);
pnlPeopleInfo.add(cbSort);
JLabel lblNewLabel_22 = new JLabel("\u0418\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u043E:");
lblNewLabel_22.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_22.setBounds(161, 11, 150, 25);
pnlPeopleInfo.add(lblNewLabel_22);
JLabel lblNewLabel_23 = new JLabel(
"\u0421\u043E\u0440\u0442\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043F\u043E:");
lblNewLabel_23.setFont(new Font("Tahoma", Font.BOLD, 15));
lblNewLabel_23.setBounds(161, 47, 142, 25);
pnlPeopleInfo.add(lblNewLabel_23);
JButton btnShow_20 = new JButton("\u041F\u043E\u043A\u0430\u0437\u0430\u0442\u044C");
btnShow_20.addActionListener(new ActionListener() {
public void actionPerformed(ActionEvent e) {
// TODO ïîëîæåíèå òàáëèöû
// A1_tutors_info (IN sort_type TINYINT, OUT result_status TINYINT)
// A2_students_info (IN sort_type TINYINT, OUT result_status TINYINT)
String who = (String) cbStudTeach_1.getSelectedItem();
String sort = cbSort.getSelectedIndex() + "";
String procedure;
if (who.equals("Ñòóäåíòû"))
procedure = "A2_students_info";
else
procedure = "A1_tutors_info";
String[] names = { "sort_type" };
String[] types = { "Int" };
String[] values = { sort };
try {
ResultSet response = db.request(procedure, names, types, values);
JTable table = fill_table(response);
table.setEnabled(false);
spPeopleInfo.setViewportView(table);
} catch (SQLException e1) {
e1.printStackTrace();
}
}
});
btnShow_20.setFont(new Font("Tahoma", Font.BOLD, 15));
btnShow_20.setBounds(587, 28, 129, 25);
pnlPeopleInfo.add(btnShow_20);
pnlAddClass = new JPanel();
lpFeatures.add(pnlAddClass, "name_210257722133500");
pnlAddClass.setLayout(null);
fldClassName = new JTextField();
fldClassName.setFont(new Font("Tahoma", Font.BOLD, 15));
fldClassName.setHorizontalAlignment(SwingConstants.CENTER);
fldClassName.setBounds(354, 110, 240, 25);
pnlAddClass.add(fldClassName);
fldClassName.setColumns(10);
fldClass = new JTextField();
fldClass.setFont(new Font("Tahoma", Font.BOLD, 15));
fldClass.setHorizontalAlignment(SwingConstants.CENTER);
fldClass.setBounds(355, 178, 148, 25);
pnlAddClass.add(fldClass);
fldClass.setColumns(10);
cbBuilding_1 = new JComboBox();
cbBuilding_1.setFont(new Font("Tahoma", Font.BOLD, 15));
cbBuilding_1.setModel(
new DefaultComboBoxModel(new String[] { "\u041A\u043E\u0440\u043F\u0443\u0441", "\u0410", "\u0411" }));
cbBuilding_1.setSelectedIndex(0);
cbBuilding_1.setBounds(513, 178, 82, 25);
pnlAddClass.add(cbBuilding_1);
fldDate = new JTextField();
fldDate.setForeground(Color.LIGHT_GRAY);
fldDate.setText("dd.mm.yyyy");
fldDate.setFont(new Font("Tahoma", Font.BOLD, 15));
fldDate.setHorizontalAlignment(SwingConstants.CENTER);
fldDate.addMouseListener(new MouseAdapter() {
public void mousePressed(MouseEvent e) {
if (fldDate.getText().equals("dd.mm.yyyy")) {
fldDate.setText("");
fldDate.setForeground(Color.BLACK);
}
}
});
fldDate.setBounds(354, 40, 240, 25);
pnlAddClass.add(fldDate);
fldTime = new JTextField();
fldTime.setForeground(Color.LIGHT_GRAY);
fldTime.setText("hh:mm");