diff --git a/src/main/java/game/StartTicTacToeGame.java b/src/main/java/game/StartTicTacToeGame.java index 1fec784..65db32c 100644 --- a/src/main/java/game/StartTicTacToeGame.java +++ b/src/main/java/game/StartTicTacToeGame.java @@ -44,13 +44,7 @@ public class StartTicTacToeGame implements ActionListener{ gui.Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); gui.Frame.getContentPane().setBackground(Color.BLACK); - - 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); + drawGameCanvas(); fieldButton = new JButton(); fieldButton.setBackground(Color.white); @@ -113,11 +107,22 @@ public class StartTicTacToeGame implements ActionListener{ backButton.setVisible(false); backButton.setFont(new Font("arial", Font.PLAIN, 16)); backButton.setText("Zurück"); - gui.Frame.add(backButton); - - + 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;