-
Notifications
You must be signed in to change notification settings - Fork 0
/
Frame.java
88 lines (59 loc) · 2.09 KB
/
Frame.java
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
import java.awt.*;
import java.awt.event.ActionEvent;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
import javax.swing.*;
import javax.swing.border.Border;
public class Frame extends JFrame {
//sets up beginning frame
public void setUpFrame() {
Container ct = getContentPane();
ct.setLayout(new BorderLayout());
this.setPreferredSize(new Dimension(800,800));
JPanel centerGrid = new JPanel(new GridLayout(2,2,5,5));
Font myFont = new Font("Serif",Font.BOLD, 36);
//making label purdy
JLabel label= new JLabel("Please select a game");
label.setFont(myFont);
label.setHorizontalAlignment(SwingConstants.CENTER);
label.setPreferredSize(new Dimension(100,100));
label.setBackground(Color.lightGray);
label.setOpaque(true);
JPanel topPanel = new JPanel();
ct.add(centerGrid, BorderLayout.CENTER);
ct.add(label, BorderLayout.NORTH);
// ct.add(topPanel, BorderLayout.NORTH);
// add the jbuttons to select the game
JButton k = new StartButton(this, 1);
k.setText("Play Kakarasu");
k.setFont(myFont);
k.setBackground(Color.ORANGE);
k.setOpaque(true);
k.setBorderPainted(false);
JButton s = new StartButton(this, 2);
s.setText("Play Skyscraper");
s.setFont(myFont);
s.setBackground(Color.decode("#247BA0"));
s.setOpaque(true);
s.setBorderPainted(false);
JButton h = new StartButton(this, 3);
h.setText("Play Hitori");
h.setFont(myFont);
h.setBackground(Color.decode("#247BA0"));
h.setOpaque(true);
h.setBorderPainted(false);
JButton ko = new StartButton(this, 4);
ko.setText("Play Kurodoko");
ko.setFont(myFont);
ko.setBackground(Color.ORANGE);
ko.setOpaque(true);
ko.setBorderPainted(false);
centerGrid.add(k);
centerGrid.add(s);
centerGrid.add(h);
centerGrid.add(ko);
ct.validate();
ct.repaint();
}
}