Browse Source

refactoring: added method drawGameCanvas

master
TRC9696 2 years ago
parent
commit
bbe19c44fe
  1. 19
      src/main/java/game/StartTicTacToeGame.java

19
src/main/java/game/StartTicTacToeGame.java

@ -44,13 +44,7 @@ public class StartTicTacToeGame implements ActionListener{
gui.Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); gui.Frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
gui.Frame.getContentPane().setBackground(Color.BLACK); 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 = new JButton();
fieldButton.setBackground(Color.white); fieldButton.setBackground(Color.white);
@ -115,9 +109,20 @@ public class StartTicTacToeGame implements ActionListener{
backButton.setText("Zurück"); 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() { public void player1Turn() {
player1Turn = true; player1Turn = true;
player2Turn = false; player2Turn = false;

Loading…
Cancel
Save