forked from zpltys/Othello
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainFrame.java
56 lines (45 loc) · 1.29 KB
/
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
import java.awt.*;
import javax.swing.*;
public class MainFrame extends JFrame {
private Board board;
public JTextArea white, black, turn;
public MyMenu myMenu;
public MainFrame() {
JPanel jp = new JPanel();
jp.setLayout(new FlowLayout());
board = new Board();
board.mainFrame = this;
jp.add(board);
white = new JTextArea("\tWhite:\t2");
black = new JTextArea("\tBlack:\t2");
turn = new JTextArea("\tNext:\tblack");
white.setColumns(30);
black.setColumns(30);
turn.setColumns(30);
white.setBackground(Color.gray);
black.setBackground(Color.gray);
turn.setBackground(Color.gray);
white.setEditable(false);
black.setEditable(false);
turn.setEditable(false);
jp.add(white);
jp.add(black);
jp.add(turn);
jp.setBackground(Color.gray);
setSize(350, 400);
setLocation(500, 250);
add(jp);
setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
setVisible(true);
}
public void setAi(boolean f) {
board.testAi = f;
}
public void setTurn(int t) {
board.turn = t;
board.initTurn = t;
}
public static void main(String args[]) {
new MainFrame();
}
}