-
Notifications
You must be signed in to change notification settings - Fork 3
/
Window.java
56 lines (39 loc) · 949 Bytes
/
Window.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
//Class for JFrame extension.
import javax.swing.*;
/*/
* Window that holds the Display JPanel.
*/
public class Window extends JFrame {
//Variable for final JFrame size.
private final int HEIGHT = 800;
private final int WIDTH = 800;
/**
* Default constructor.
*/
Window(boolean pause) {
//Set the title.
setTitle("Frogger Remix");
//Set the size of the JFrame.
setSize(WIDTH, HEIGHT);
//Set window to screen center.
setLocationRelativeTo(null);
//Specify the close button action.
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
//set resize.
setResizable(false);
//Add panel to frame.
add(new Display(pause));
//Display the window.
setVisible(true);
}
/**
* Main constructor to start program.
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
//Pause game if first run.
final boolean pause = true;
//Create window for game.
new Window(pause);
}
}