-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCustomPanel.java
More file actions
51 lines (45 loc) · 1.49 KB
/
CustomPanel.java
File metadata and controls
51 lines (45 loc) · 1.49 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
/**
* This class displays a panel that allows the user to view, rename,
* reorder, and delete custom levels. It displays multiple
* CustomLevelDisplayPanels.
* <p>
* Priscilla implemented this class on her own.
*
* @author Priscilla Lee
* @version December 25, 2014
*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class CustomPanel extends JPanel {
//private instance vars
private JLabel help;
private JPanel displayPanel;
private GamePanel gamePanel;
/**
* Constructor that takes in a GamePanel as input.
*
* @param gp the GamePanel that will contain this panel
*/
public CustomPanel(GamePanel gp) {
gamePanel = gp;
//setting background & size
setPreferredSize(new Dimension(700,500));
setMinimumSize(new Dimension(700,500));
setBackground(ColorScheme.background());
//initialize help label, adjust design, add
String h = "INSTRUCTIONS WILL GO HERE";
help = new JLabel("<html><font color='white'>"+h+"</font><html>");
help.setFont(new Font("Calibri", Font.BOLD, 20));
help.setOpaque(true);
help.setBackground(ColorScheme.labels());
help.setBorder(BorderScheme.padding());
help.setHorizontalAlignment(JLabel.CENTER);
add(help);
//initialize display panel, set layout, adjust design, add
displayPanel = new JPanel();
displayPanel.setLayout(new BoxLayout(displayPanel, BoxLayout.Y_AXIS));
displayPanel.setBackground(ColorScheme.background());
add(displayPanel);
}
}