-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathButtonContainerPanel.java
More file actions
47 lines (33 loc) · 1.09 KB
/
ButtonContainerPanel.java
File metadata and controls
47 lines (33 loc) · 1.09 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
import java.awt.BorderLayout;
import java.awt.Dimension;
import javax.swing.JPanel;
public class ButtonContainerPanel {
private static ButtonContainerPanel panel;
private JPanel containerPanel;
//singleton so only one container can exist
public static ButtonContainerPanel panel() {
if (panel == null) {
panel = new ButtonContainerPanel();
}
return panel;
}
public ButtonContainerPanel() {
}
//initialize
public void initialize() {
this.containerPanel = new JPanel();
formatPanel();
}
//format the panel
public void formatPanel() {
containerPanel.setLayout(new BorderLayout());
containerPanel.setPreferredSize(new Dimension(300, 400));
containerPanel.add(UserButtonsPanel.panel().render(), BorderLayout.NORTH);
containerPanel.add(AnalysisButtonPanel.panel().render(), BorderLayout.SOUTH);
}
//render the panel
public JPanel render() {
initialize();
return this.containerPanel;
}
}