-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSemesterTab.java
More file actions
65 lines (40 loc) · 1.11 KB
/
Copy pathSemesterTab.java
File metadata and controls
65 lines (40 loc) · 1.11 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
//Dylan Barrett
//Description
//1/13/25
import javax.swing.*;
import java.awt.*;
import java.awt.event.KeyEvent;
import java.awt.event.KeyListener;
import java.util.ArrayList;
public class SemesterTab extends JTabbedPane {
private BigDuty bigDuty;
private ArrayList<CustomPanel> panels;
public static GUIMain gui;
private String name;
public SemesterTab(BigDuty bigDuty, String name) {
this.bigDuty = bigDuty;
this.panels = new ArrayList<>();
this.bigDuty.setPane(this);
this.name = name;
}
public void addTab(String title, Component component) {
super.addTab(title, component);
if(component instanceof CustomPanel) {
panels.add((CustomPanel) component);
}
}
public void refreshPanels() {
for (CustomPanel panel : panels) {
panel.refreshPanel();
}
}
public void keyPressed(KeyEvent e) {
System.out.println(bigDuty.getSemester());
}
public BigDuty getBigDuty() {
return bigDuty;
}
public String getName() {
return name;
}
}