forked from laboon/SlowLifeGUI
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainFrame.java
33 lines (20 loc) · 698 Bytes
/
MainFrame.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
import java.awt.*;
import javax.swing.*;
public class MainFrame {
private final int HEIGHT = 600;
private final int WIDTH = 800;
private JFrame _frame = new JFrame("Game of Life");
private MainPanel _mainPanel;
private ButtonPanel _buttonPanel;
public MainFrame(int size) {
_frame.setSize(WIDTH, HEIGHT);
// Close program when window is closed
_frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
// Add Main Panel and Button Panel
_mainPanel = new MainPanel(size);
_buttonPanel = new ButtonPanel(_mainPanel);
_frame.add(_mainPanel, BorderLayout.NORTH);
_frame.add(_buttonPanel, BorderLayout.SOUTH);
_frame.setVisible(true);
}
}