|
|
@ -46,6 +46,20 @@ public class StartTicTacToeGame implements ActionListener{ |
|
|
|
|
|
|
|
drawGameCanvas(); |
|
|
|
|
|
|
|
drawAndPlaceButtons(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void drawGameCanvas() { |
|
|
|
TicTacToeLabel = new JLabel(); |
|
|
|
TicTacToeLabel.setText("Tic-Tac-Toe"); |
|
|
|
TicTacToeLabel.setForeground(Color.white); |
|
|
|
TicTacToeLabel.setFont(new Font("arial", Font.PLAIN, 30)); |
|
|
|
TicTacToeLabel.setBounds(320,20,500,50); |
|
|
|
gui.Frame.add(TicTacToeLabel); |
|
|
|
} |
|
|
|
|
|
|
|
public void drawAndPlaceButtons() { |
|
|
|
fieldButton = new JButton(); |
|
|
|
fieldButton.setBackground(Color.white); |
|
|
|
fieldButton.setBounds(200, 100, 100,100); |
|
|
@ -108,21 +122,9 @@ public class StartTicTacToeGame implements ActionListener{ |
|
|
|
backButton.setFont(new Font("arial", Font.PLAIN, 16)); |
|
|
|
backButton.setText("Zurück"); |
|
|
|
gui.Frame.add(backButton); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void drawGameCanvas() { |
|
|
|
TicTacToeLabel = new JLabel(); |
|
|
|
TicTacToeLabel.setText("Tic-Tac-Toe"); |
|
|
|
TicTacToeLabel.setForeground(Color.white); |
|
|
|
TicTacToeLabel.setFont(new Font("arial", Font.PLAIN, 30)); |
|
|
|
TicTacToeLabel.setBounds(320,20,500,50); |
|
|
|
gui.Frame.add(TicTacToeLabel); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public void player1Turn() { |
|
|
|
player1Turn = true; |
|
|
|
player2Turn = false; |
|
|
|