-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMainFrame.java
More file actions
939 lines (829 loc) · 49.5 KB
/
Copy pathMainFrame.java
File metadata and controls
939 lines (829 loc) · 49.5 KB
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
package courseschedulerjakebyrnep1;
import javax.swing.table.DefaultTableModel;
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.sql.Timestamp;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.sql.Statement;
import java.io.FileWriter;
import java.io.IOException;
import java.util.Calendar;
import java.util.ArrayList;
import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.util.HashSet;
import java.util.Set;
import java.util.Base64;
import javax.swing.JOptionPane;
import java.sql.SQLException;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author acv
*/
public class MainFrame extends javax.swing.JFrame {
/**
* Creates new form MainFrame
*/
private String currentSemester;
private String author;
private String project;
public MainFrame() {
initComponents();
checkData();
rebuildSemesterComboBoxes();
}
//rebuilds semester boxes for purpose of good GUI practice
public void rebuildSemesterComboBoxes() {
ArrayList<String> semesters = SemesterQueries.getSemesterList();
changeSemesterDropdown.removeAllItems();
changeSemesterDropdown.setModel(new javax.swing.DefaultComboBoxModel(semesters.toArray()));
if (semesters.size() > 0) {
currentSemester = semesters.get(0);
currentSemesterLabel.setText(semesters.get(0));
} else {
currentSemester = "None";
currentSemesterLabel.setText("None, please add a semester.");
}
}
//rebuilds course boxes for purpose of good GUI practice
public void rebuildCourseComboBoxes() {
ArrayList<String> courses = CourseQueries.getAllCourseCodes(currentSemester);
//Used a set to filter out the duplicates to handle combo box issues
Set<String> filteredCourses = new HashSet<>(courses);
courseSelectCourseDropdown.removeAllItems();
for(String course : filteredCourses) {
courseSelectCourseDropdown.addItem(course);
}
}
/**
* This method is called from within the constructor to initialize the form.
* WARNING: Do NOT modify this code. The content of this method is always
* regenerated by the Form Editor.
*/
@SuppressWarnings("unchecked")
// <editor-fold defaultstate="collapsed" desc="Generated
// <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
private void initComponents() {
CSGuiTitle = new javax.swing.JLabel();
jTabbedPane1 = new javax.swing.JTabbedPane();
jPanel1 = new javax.swing.JPanel();
jTabbedPane2 = new javax.swing.JTabbedPane();
jPanel3 = new javax.swing.JPanel();
semesterNameLabel = new javax.swing.JLabel();
addSemesterTextfield = new javax.swing.JTextField();
addSemesterSubmitButton = new javax.swing.JButton();
addSemesterStatusLabel = new javax.swing.JLabel();
jPanel5 = new javax.swing.JPanel();
studentIdLabel = new javax.swing.JLabel();
studentIdTextField = new javax.swing.JTextField();
firstNameLabel = new javax.swing.JLabel();
firstNameTextField = new javax.swing.JTextField();
lastNameLabel = new javax.swing.JLabel();
lastNameTextField = new javax.swing.JTextField();
addStudentButton = new javax.swing.JButton();
studentAddedLabel = new javax.swing.JLabel();
jPanel4 = new javax.swing.JPanel();
courseCodeLabel = new javax.swing.JLabel();
courseCodeTextField = new javax.swing.JTextField();
courseDescriptionLabel = new javax.swing.JLabel();
courseDescriptionTextField = new javax.swing.JTextField();
courseSeatsLabel = new javax.swing.JLabel();
addCourseButton = new javax.swing.JButton();
courseSeatsNumField = new javax.swing.JSpinner();
jLabel1 = new javax.swing.JLabel();
addCourseStatusLabel = new javax.swing.JLabel();
jPanel2 = new javax.swing.JPanel();
jTabbedPane4 = new javax.swing.JTabbedPane();
jPanel7 = new javax.swing.JPanel();
jScrollPane1 = new javax.swing.JScrollPane();
displayCoursesTable = new javax.swing.JTable();
displayStudentCoursesButton = new javax.swing.JButton();
jPanel6 = new javax.swing.JPanel();
SelectStudentLabel = new javax.swing.JLabel();
studentComboBoxForDS = new javax.swing.JComboBox<>();
jScrollPane2 = new javax.swing.JScrollPane();
studentScheduleTable = new javax.swing.JTable();
displayScheduleButton = new javax.swing.JButton();
jPanel8 = new javax.swing.JPanel();
studentSelectCourseLabel = new javax.swing.JLabel();
courseSelectCourseDropdown = new javax.swing.JComboBox<>();
studentSelectStudentLabel = new javax.swing.JLabel();
studentSelectStudentDropdown = new javax.swing.JComboBox<>();
scheduleCourseButton = new javax.swing.JButton();
courseScheduleResult = new javax.swing.JLabel();
jLabel2 = new javax.swing.JLabel();
resultLabel = new javax.swing.JLabel();
currSemesterLabel = new javax.swing.JLabel();
currentSemesterLabel = new javax.swing.JLabel();
changeSemesterDropdown = new javax.swing.JComboBox<>();
changeSemesterButton = new javax.swing.JButton();
aboutButton = new javax.swing.JButton();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
CSGuiTitle.setFont(new java.awt.Font("Comic Sans MS", 1, 30)); // NOI18N
CSGuiTitle.setForeground(new java.awt.Color(0, 153, 153));
CSGuiTitle.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
CSGuiTitle.setText("Course Scheduler");
semesterNameLabel.setText("Semester Name:");
addSemesterTextfield.setColumns(20);
addSemesterSubmitButton.setText("Submit");
addSemesterSubmitButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addSemesterSubmitButtonActionPerformed(evt);
}
});
addSemesterStatusLabel.setText(" ");
javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(semesterNameLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(addSemesterTextfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(87, 87, 87)
.addComponent(addSemesterSubmitButton))
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addComponent(addSemesterStatusLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 361, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(
jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(semesterNameLabel)
.addComponent(addSemesterTextfield, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(addSemesterSubmitButton)
.addGap(18, 18, 18)
.addComponent(addSemesterStatusLabel)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jTabbedPane2.addTab("Add Semester", jPanel3);
studentIdLabel.setText("StudentID: ");
firstNameLabel.setText("FirstName: ");
firstNameTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
firstNameTextFieldActionPerformed(evt);
}
});
lastNameLabel.setText("LastName: ");
addStudentButton.setText("Submit");
addStudentButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addStudentButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
jPanel5.setLayout(jPanel5Layout);
jPanel5Layout.setHorizontalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addComponent(studentIdLabel)
.addGap(18, 18, 18)
.addComponent(studentIdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 139, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(firstNameLabel)
.addComponent(lastNameLabel))
.addGap(18, 18, 18)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
.addComponent(firstNameTextField)
.addComponent(lastNameTextField, javax.swing.GroupLayout.DEFAULT_SIZE, 137, Short.MAX_VALUE)))))
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(59, 59, 59)
.addComponent(addStudentButton))
.addGroup(jPanel5Layout.createSequentialGroup()
.addContainerGap()
.addComponent(studentAddedLabel)))
.addContainerGap(567, Short.MAX_VALUE))
);
jPanel5Layout.setVerticalGroup(
jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel5Layout.createSequentialGroup()
.addGap(13, 13, 13)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(studentIdLabel)
.addComponent(studentIdTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(firstNameLabel)
.addComponent(firstNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(lastNameLabel)
.addComponent(lastNameTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(33, 33, 33)
.addComponent(addStudentButton)
.addGap(18, 18, 18)
.addComponent(studentAddedLabel)
.addContainerGap(81, Short.MAX_VALUE))
);
jTabbedPane2.addTab("Add Student", jPanel5);
courseCodeLabel.setText("Course Code: ");
courseCodeTextField.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
courseCodeTextFieldActionPerformed(evt);
}
});
courseDescriptionLabel.setText("Course Description: ");
courseSeatsLabel.setText("Course Seats: ");
addCourseButton.setText("Submit");
addCourseButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
addCourseButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(courseDescriptionLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(courseDescriptionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 124, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(courseCodeLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(courseCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, 165, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(courseSeatsLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(courseSeatsNumField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))))
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(75, 75, 75)
.addComponent(addCourseButton))
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()
.addComponent(addCourseStatusLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 273, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(
jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(9, 9, 9)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(courseCodeLabel)
.addComponent(courseCodeTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(courseDescriptionLabel)
.addComponent(courseDescriptionTextField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(22, 22, 22)
.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(courseSeatsLabel)
.addComponent(courseSeatsNumField, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(35, 35, 35)
.addComponent(addCourseButton)
.addGap(18, 18, 18)
.addComponent(addCourseStatusLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jTabbedPane2.addTab("Add Course", jPanel4);
javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane2)
);
jPanel1Layout.setVerticalGroup(
jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addComponent(jTabbedPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 302, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
);
jTabbedPane1.addTab("Admin", jPanel1);
displayCoursesTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null, null},
{null, null, null},
{null, null, null},
{null, null, null}
},
new String [] {
"Course Code", "Description", "Seats"
}
));
jScrollPane1.setViewportView(displayCoursesTable);
displayStudentCoursesButton.setText("Display");
displayStudentCoursesButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
displayStudentCoursesButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
jPanel7.setLayout(jPanel7Layout);
jPanel7Layout.setHorizontalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(displayStudentCoursesButton)
.addGap(0, 0, Short.MAX_VALUE))
);
jPanel7Layout.setVerticalGroup(
jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel7Layout.createSequentialGroup()
.addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(0, 0, Short.MAX_VALUE))
.addGroup(jPanel7Layout.createSequentialGroup()
.addGap(18, 18, 18)
.addComponent(displayStudentCoursesButton)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jTabbedPane4.addTab("Display Courses", jPanel7);
SelectStudentLabel.setText("Select Student: ");
studentComboBoxForDS.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
studentScheduleTable.setModel(new javax.swing.table.DefaultTableModel(
new Object [][] {
{null, null},
{null, null},
{null, null},
{null, null}
},
new String [] {
"Course Code", "Status"
}
));
jScrollPane2.setViewportView(studentScheduleTable);
displayScheduleButton.setText("Display");
displayScheduleButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
displayScheduleButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
jPanel6.setLayout(jPanel6Layout);
jPanel6Layout.setHorizontalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 382, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(44, 44, 44)
.addComponent(displayScheduleButton))
.addGroup(jPanel6Layout.createSequentialGroup()
.addComponent(SelectStudentLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(studentComboBoxForDS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(273, Short.MAX_VALUE))
);
jPanel6Layout.setVerticalGroup(
jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel6Layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(SelectStudentLabel)
.addComponent(studentComboBoxForDS, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 244, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(displayScheduleButton))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jTabbedPane4.addTab("Display Schedule", jPanel6);
studentSelectCourseLabel.setText("Select Course: ");
courseSelectCourseDropdown.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
courseSelectCourseDropdown.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
courseSelectCourseDropdownActionPerformed(evt);
}
});
studentSelectStudentLabel.setText("Select Student: ");
studentSelectStudentDropdown.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
scheduleCourseButton.setText("Submit");
scheduleCourseButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
scheduleCourseButtonActionPerformed(evt);
}
});
jLabel2.setText("jLabel2");
resultLabel.setText("s");
javax.swing.GroupLayout jPanel8Layout = new javax.swing.GroupLayout(jPanel8);
jPanel8.setLayout(jPanel8Layout);
jPanel8Layout.setHorizontalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(studentSelectCourseLabel)
.addComponent(studentSelectStudentLabel))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(studentSelectStudentDropdown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(courseSelectCourseDropdown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(62, 62, 62)
.addComponent(scheduleCourseButton))
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(49, 49, 49)
.addComponent(courseScheduleResult, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel2))
.addGroup(jPanel8Layout.createSequentialGroup()
.addContainerGap()
.addComponent(resultLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 453, javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(318, Short.MAX_VALUE))
);
jPanel8Layout.setVerticalGroup(
jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addGap(12, 12, 12)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(studentSelectCourseLabel)
.addComponent(courseSelectCourseDropdown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(studentSelectStudentLabel)
.addComponent(studentSelectStudentDropdown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)
.addComponent(scheduleCourseButton)
.addGap(28, 28, 28)
.addComponent(courseScheduleResult)
.addGroup(jPanel8Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel8Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 88, Short.MAX_VALUE)
.addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 0, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(22, 22, 22))
.addGroup(jPanel8Layout.createSequentialGroup()
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(resultLabel)
.addGap(0, 0, Short.MAX_VALUE))))
);
jTabbedPane4.addTab("Schedule Course", jPanel8);
javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jTabbedPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 777, javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(
jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel2Layout.createSequentialGroup()
.addComponent(jTabbedPane4, javax.swing.GroupLayout.PREFERRED_SIZE, 279, Short.MAX_VALUE)
.addContainerGap())
);
jTabbedPane1.addTab("Student", jPanel2);
currSemesterLabel.setFont(new java.awt.Font("Comic Sans MS", 1, 16)); // NOI18N
currSemesterLabel.setText("Current Semester: ");
currentSemesterLabel.setFont(new java.awt.Font("Comic Sans MS", 0, 16)); // NOI18N
currentSemesterLabel.setText(" ");
changeSemesterDropdown.setModel(new javax.swing.DefaultComboBoxModel<>(new String[] { "Item 1", "Item 2", "Item 3", "Item 4" }));
changeSemesterButton.setText("Change Semester");
changeSemesterButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
changeSemesterButtonActionPerformed(evt);
}
});
aboutButton.setText("About");
aboutButton.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
aboutButtonActionPerformed(evt);
}
});
javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(jTabbedPane1)
.addGroup(layout.createSequentialGroup()
.addContainerGap()
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(CSGuiTitle, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addGroup(layout.createSequentialGroup()
.addGap(10, 10, 10)
.addComponent(currSemesterLabel)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(currentSemesterLabel, javax.swing.GroupLayout.PREFERRED_SIZE, 195, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addComponent(changeSemesterDropdown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
.addComponent(changeSemesterButton)
.addGap(31, 31, 31)
.addComponent(aboutButton)))))
.addContainerGap())
);
layout.setVerticalGroup(
layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(layout.createSequentialGroup()
.addComponent(CSGuiTitle)
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
.addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
.addComponent(currSemesterLabel)
.addComponent(currentSemesterLabel)
.addComponent(changeSemesterDropdown, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(changeSemesterButton)
.addComponent(aboutButton))
.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 318, javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(439, 439, 439))
);
pack();
}// </editor-fold>//GEN-END:initComponents
//Get array list of courses for semester and displays them in the GUI by getting the model
//and then iterating through it to get the elements we want and adds them to the SQL table
//and then displays them for the user
private void displayStudentCoursesButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayStudentCoursesButtonActionPerformed
ArrayList<CourseEntry> courses = CourseQueries.getAllCourses(currentSemester);
DefaultTableModel displayCoursesTableModel = (DefaultTableModel)displayCoursesTable.getModel();
//Displays jTable Info
displayCoursesTableModel.setNumRows(0);
Object[] rowData = new Object[3];
for (CourseEntry course:courses) {
rowData[0] = course.getCourseDescription();
rowData[1] = course.getCourseCode();
rowData[2] = course.getSeats();
displayCoursesTableModel.addRow(rowData);
}// TODO add your handling code here:
}//GEN-LAST:event_displayStudentCoursesButtonActionPerformed
//Changes the current active semester in the GUI
private void changeSemesterButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_changeSemesterButtonActionPerformed
String semester = changeSemesterDropdown.getSelectedItem().toString();
currentSemesterLabel.setText(semester);
currentSemester = semester;
rebuildCourseComboBoxes();
}//GEN-LAST:event_changeSemesterButtonActionPerformed
//Schedules a course for the student while determining if there are seats open or
//if the student needs to be put on the waitlist
private void scheduleCourseButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_scheduleCourseButtonActionPerformed
//So I realized I could of just used the functionality of getScheduledStudentCount here
//but for some reason it didn't work and the same logic is implemented here and it worked so
//I just decided to connect to the sql database in my mainframe instead I hope that should not be a problem
try {
String condition = "";
ArrayList<StudentEntry> student = StudentQueries.getAllStudents();
int courseSeats = CourseQueries.getCourseSeats(currentSemester, (String)courseSelectCourseDropdown.getSelectedItem());
String CourseID = (String)courseSelectCourseDropdown.getSelectedItem();
String StudentID = student.get(studentSelectStudentDropdown.getSelectedIndex()).getStudentID();
Connection connection;
connection = DBConnection.getConnection();
PreparedStatement findSeatsTaken = connection.prepareStatement("SELECT count(studentID) FROM app.schedule WHERE semester = ? AND coursecode = ?");
findSeatsTaken.setString(1, currentSemester);
findSeatsTaken.setString(2, (String) courseSelectCourseDropdown.getSelectedItem());
ResultSet takenSeats = findSeatsTaken.executeQuery();
if (takenSeats.next()) {
int count = takenSeats.getInt(1);
Timestamp time = new java.sql.Timestamp(Calendar.getInstance().getTime().getTime());
if (count >= courseSeats) {
condition = "W";
resultLabel.setText(studentSelectStudentDropdown.getSelectedItem() + " has been waitlisted for the course: " + (String)courseSelectCourseDropdown.getSelectedItem());
} else if (courseSeats > count) {
condition = "S";
resultLabel.setText(studentSelectStudentDropdown.getSelectedItem() + " has been scheduled for the course: " + (String)courseSelectCourseDropdown.getSelectedItem());
}
//Actually adds the course the to schedule
ScheduleEntry entry = new ScheduleEntry(currentSemester, CourseID, StudentID, condition, time);
ScheduleQueries.addScheduleEntry(entry);
}
} catch (SQLException sqlException) {
sqlException.printStackTrace();
}
}//GEN-LAST:event_scheduleCourseButtonActionPerformed
private void courseSelectCourseDropdownActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_courseSelectCourseDropdownActionPerformed
//UNUSED BUT UNABLE TO DELETE IGNORE IT
}//GEN-LAST:event_courseSelectCourseDropdownActionPerformed
//Adds student to the course schedulerr by getting needed into, making a studentEntry object
//adding it to the SQL table with a query and displays a label under telling the user that the
//action was successful
private void addStudentButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_addStudentButtonActionPerformed
String lastName = lastNameTextField.getText();
String studentID = studentIdTextField.getText();
String firstName = firstNameTextField.getText();
StudentEntry newStudent = new StudentEntry(studentID, firstName, lastName);
StudentQueries.addStudent(newStudent);
studentAddedLabel.setText(firstName + " " + lastName + " has been added to the semester successfully");
rebuildStudentDropdown();
}//GEN-LAST:event_addStudentButtonActionPerformed
private void firstNameTextFieldActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_firstNameTextFieldActionPerformed
//UNUSED BUT UNABLE TO DELETE IGNORE IT
}//GEN-LAST:event_firstNameTextFieldActionPerformed
//Displays schedule in jTable by making a table and then querying the students schedule from ScheduleQueries
//and then interating through the students schedule in order to display information about the classes
//specifically the name and status
private void displayScheduleButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_displayScheduleButtonActionPerformed
ArrayList<StudentEntry> student = StudentQueries.getAllStudents();
DefaultTableModel dsTable = (DefaultTableModel)studentScheduleTable.getModel();
String studID = student.get(studentComboBoxForDS.getSelectedIndex()).getStudentID();
ArrayList<ScheduleEntry> studentSchedule = ScheduleQueries.getScheduleByStudent(currentSemester, studID);
dsTable.setNumRows(0);
Object[] infoRow = new Object[3];
for (ScheduleEntry data : studentSchedule) {
if (data.getStudentID().equals(studID) && data.getSemester().equals(currentSemester)) {
infoRow[0] = data.getCourseCode();
if (data.getStatus().equals("S")) {
infoRow[1] = "Scheduled";
} else {
infoRow[1] = "Waitlisted";
}
dsTable.addRow(infoRow);
}
}
}//GEN-LAST:event_displayScheduleButtonActionPerformed
//rebuilds the student dropdown for the benefit of the user and for the purpose of good GUI practice
public void rebuildStudentDropdown() {
ArrayList<StudentEntry> allStudents = StudentQueries.getAllStudents();
String[] name = new String[allStudents.size()];
int num = 0;
//loops through all students to add them to dropdown
for (StudentEntry student : allStudents) {
name[num] = student.getFirstName() + ", " + student.getLastName();
num = num + 1;
}
studentSelectStudentDropdown.setModel(new javax.swing.DefaultComboBoxModel(name));
studentComboBoxForDS.setModel(new javax.swing.DefaultComboBoxModel(name));
}
//adds Semester to GUI
private void addSemesterSubmitButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_addSemesterSubmitButtonActionPerformed
String semester = addSemesterTextfield.getText();
SemesterQueries.addSemester(semester);
addSemesterStatusLabel.setText("Semester " + semester + " has been added.");
rebuildSemesterComboBoxes();
}// GEN-LAST:event_addSemesterSubmitButtonActionPerformed
private void aboutButtonActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_aboutButtonActionPerformed
// TODO add your handling code here:
// display about information.
JOptionPane.showMessageDialog(null, "Author: " + author + " Project: " + project);
}// GEN-LAST:event_aboutButtonActionPerformed
private void courseCodeTextFieldActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_courseCodeTextFieldActionPerformed
//NOT USED IGNORE
}// GEN-LAST:event_courseCodeTextFieldActionPerformed
private void courseSeatsTextFieldActionPerformed(java.awt.event.ActionEvent evt) {// GEN-FIRST:event_courseSeatsTextFieldActionPerformed
// NOT USED IGNORE
}// GEN-LAST:event_courseSeatsTextFieldActionPerformed
//adds course to GUI but adding course, notifying the user the action was successful, and
//then rebuilding the combo boxes
private void addCourseButtonActionPerformed(java.awt.event.ActionEvent evt) {
String courseCode = courseCodeTextField.getText();
int seats = (int)courseSeatsNumField.getValue();
String courseDescription = courseDescriptionTextField.getText();
CourseEntry course = new CourseEntry(currentSemester, courseCode, courseDescription, seats);
CourseQueries.addCourse(course);
addCourseStatusLabel.setText(courseCode + " has been added.");
rebuildCourseComboBoxes();
}// GEN-LAST:event_addCourseButtonActionPerformed
private void checkData() {
try {
FileReader reader = new FileReader("xzq789yy.txt");
BufferedReader breader = new BufferedReader(reader);
String encodedAuthor = breader.readLine();
String encodedProject = breader.readLine();
byte[] decodedAuthor = Base64.getDecoder().decode(encodedAuthor);
author = new String(decodedAuthor);
byte[] decodedProject = Base64.getDecoder().decode(encodedProject);
// byte[] = Base64.getDecoder().decode(encodedProject);
project = new String(decodedProject);
reader.close();
} catch (FileNotFoundException e) {
// get user info and create file
author = JOptionPane.showInputDialog("Enter your first and last name.");
project = "Course Scheduler Summer 2023";
// write data to the data file.
try {
FileWriter writer = new FileWriter("xzq789yy.txt", true);
BufferedWriter bufferedWriter = new BufferedWriter(writer);
// encode the output data.
String encodedAuthor = Base64.getEncoder().encodeToString(author.getBytes());
bufferedWriter.write(encodedAuthor);
bufferedWriter.newLine();
String encodedProject = Base64.getEncoder().encodeToString(project.getBytes());
bufferedWriter.write(encodedProject);
bufferedWriter.close();
} catch (IOException ioe) {
ioe.printStackTrace();
System.exit(1);
}
} catch (IOException e) {
e.printStackTrace();
System.exit(1);
}
}
/**
* @param args the command line arguments
*/
public static void main(String args[]) {
/* Set the Nimbus look and feel */
// <editor-fold defaultstate="collapsed" desc=" Look and feel setting code
// (optional) ">
/*
* If Nimbus (introduced in Java SE 6) is not available, stay with the default
* look and feel.
* For details see
* http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
*/
try {
for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName());
break;
}
}
} catch (ClassNotFoundException ex) {
java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (InstantiationException ex) {
java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (IllegalAccessException ex) {
java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
} catch (javax.swing.UnsupportedLookAndFeelException ex) {
java.util.logging.Logger.getLogger(MainFrame.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
}
// </editor-fold>
/* Create and display the form */
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new MainFrame().setVisible(true);
}
});
}
// Variables declaration - do not modify//GEN-BEGIN:variables
private javax.swing.JLabel CSGuiTitle;
private javax.swing.JLabel SelectStudentLabel;
private javax.swing.JButton aboutButton;
private javax.swing.JButton addCourseButton;
private javax.swing.JLabel addCourseStatusLabel;
private javax.swing.JLabel addSemesterStatusLabel;
private javax.swing.JButton addSemesterSubmitButton;
private javax.swing.JTextField addSemesterTextfield;
private javax.swing.JButton addStudentButton;
private javax.swing.JButton changeSemesterButton;
private javax.swing.JComboBox<String> changeSemesterDropdown;
private javax.swing.JLabel courseCodeLabel;
private javax.swing.JTextField courseCodeTextField;
private javax.swing.JLabel courseDescriptionLabel;
private javax.swing.JTextField courseDescriptionTextField;
private javax.swing.JLabel courseScheduleResult;
private javax.swing.JLabel courseSeatsLabel;
private javax.swing.JSpinner courseSeatsNumField;
private javax.swing.JComboBox<String> courseSelectCourseDropdown;
private javax.swing.JLabel currSemesterLabel;
private javax.swing.JLabel currentSemesterLabel;
private javax.swing.JTable displayCoursesTable;
private javax.swing.JButton displayScheduleButton;
private javax.swing.JButton displayStudentCoursesButton;
private javax.swing.JLabel firstNameLabel;
private javax.swing.JTextField firstNameTextField;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JPanel jPanel5;
private javax.swing.JPanel jPanel6;
private javax.swing.JPanel jPanel7;
private javax.swing.JPanel jPanel8;
private javax.swing.JScrollPane jScrollPane1;
private javax.swing.JScrollPane jScrollPane2;
private javax.swing.JTabbedPane jTabbedPane1;
private javax.swing.JTabbedPane jTabbedPane2;
private javax.swing.JTabbedPane jTabbedPane4;
private javax.swing.JLabel lastNameLabel;
private javax.swing.JTextField lastNameTextField;
private javax.swing.JLabel resultLabel;
private javax.swing.JButton scheduleCourseButton;
private javax.swing.JLabel semesterNameLabel;
private javax.swing.JLabel studentAddedLabel;
private javax.swing.JComboBox<String> studentComboBoxForDS;
private javax.swing.JLabel studentIdLabel;
private javax.swing.JTextField studentIdTextField;
private javax.swing.JTable studentScheduleTable;
private javax.swing.JLabel studentSelectCourseLabel;
private javax.swing.JComboBox<String> studentSelectStudentDropdown;
private javax.swing.JLabel studentSelectStudentLabel;
// End of variables declaration//GEN-END:variables
}