-
Notifications
You must be signed in to change notification settings - Fork 3
/
Play.java
32 lines (29 loc) · 827 Bytes
/
Play.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
/**
The Play class acts an entry point
for the game. It initializes the contents
and dimensions of the frame, sets its position
relative to the screen and adds the Board component.
*/
import javax.swing.JFrame;
import java.awt.*;
public class Play extends JFrame
{
public Play()
{
Commons commons = new Commons();
add(new Board());
setTitle("Breakout");
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
getContentPane().setPreferredSize(new Dimension(300,400));
pack();
setLocationRelativeTo(null);
setVisible(true);
setResizable(false);
commons.setHeight((int)getContentPane().getHeight());
commons.setWidth((int)getContentPane().getWidth());
}
public static void main (String[] args)
{
new Play();
}
}