-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTicTacToeJFrame.java
47 lines (41 loc) · 1.01 KB
/
TicTacToeJFrame.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
/**
* @author Maxx Boehme
* @version 1
*
* Class to initiate the TicTacToe JFrame.
*/
import java.awt.*;
import javax.swing.*;
public class TicTacToeJFrame extends JFrame {
private static final long serialVersionUID = 2891272891377734444L;
private JPanel contentPane;
/**
* Launch the application.
*/
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
public void run() {
try {
TicTacToeJFrame frame = new TicTacToeJFrame();
Toolkit toolkit= frame.getToolkit();
Dimension size = toolkit.getScreenSize();
frame.setLocation(size.width/2-frame.getWidth()/2, size.height/2-frame.getHeight()/2);
frame.setVisible(true);
} catch (Exception e) {
e.printStackTrace();
}
}
});
}
/**
* Create the frame.
*/
public TicTacToeJFrame() {
setTitle("Tic-Tac-Toe");
setResizable(false);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setSize(550, 550);
contentPane = new TicTacToeContentPane();
setContentPane(contentPane);
}
}