-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDifficultyMenu.java
More file actions
50 lines (34 loc) · 1.44 KB
/
DifficultyMenu.java
File metadata and controls
50 lines (34 loc) · 1.44 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
package chessGame;
import java.awt.Color;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import javax.swing.JButton;
import javax.swing.JLabel;
import javax.swing.JPanel;
import javax.swing.border.EmptyBorder;
public class DifficultyMenu {
JPanel menuscreen;
JLabel menuTitle;
JButton b1,b2,b3;
public DifficultyMenu() {
menuscreen = new JPanel();
menuscreen.setBackground(Color.lightGray);
menuscreen.setBorder(new EmptyBorder(10, 10, 10, 10));
menuscreen.setLayout(new GridBagLayout());
GridBagConstraints gbc = new GridBagConstraints();
gbc.gridwidth = GridBagConstraints.REMAINDER;
gbc.anchor = GridBagConstraints.NORTH;
menuscreen.add(new JLabel("<html><h1><strong><i>Chess Game</i></strong></h1><hr></html>"), gbc);
gbc.anchor = GridBagConstraints.CENTER;
gbc.fill = GridBagConstraints.HORIZONTAL;
JPanel buttons = new JPanel(new GridBagLayout());
b1 = new JButton("Difficulty Level 1");
b2 = new JButton("Difficulty Level 2");
b3 = new JButton("Difficulty Level 3");
buttons.add(b1,gbc);
buttons.add(b2,gbc);
buttons.add(b3,gbc);
//gbc.weighty = 1;
menuscreen.add(buttons,gbc);
}
}