-
Notifications
You must be signed in to change notification settings - Fork 2
/
GameGUI.java
executable file
·34 lines (31 loc) · 947 Bytes
/
GameGUI.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
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.border.LineBorder;
/**
* Main GUI class of the game, which contains the JFrame, game and tree.
* In charge of putting together all the components of the GUI and
* connecting it with the game object.
*
* @author Yiran Chen
* @version 12/08/2018
*/
public class GameGUI {
public static void main(String[] args) {
// creating the main frame
JFrame frame = new JFrame ("Christams Bomb");
frame.setDefaultCloseOperation (JFrame.EXIT_ON_CLOSE);
// size
frame.setPreferredSize(new Dimension(800, 900));
ChristmasTree tree = new ChristmasTree();
Game game = new Game(tree);
// start panel
StartPanel start = new StartPanel(game);
// adding & packing
frame.getContentPane().add(start);
frame.pack();
frame.setVisible(true);
frame.setLocationRelativeTo(null);
frame.setResizable(true);
}
}