From 808702f7b80b7ae5fff28c25780a48770312db0d Mon Sep 17 00:00:00 2001 From: TRC9696 Date: Mon, 30 Jan 2023 18:04:30 +0100 Subject: [PATCH] refactoring: renamed label to TicTacToeLabel --- src/main/java/game/StartTicTacToeGame.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/main/java/game/StartTicTacToeGame.java b/src/main/java/game/StartTicTacToeGame.java index 4335435..1fec784 100644 --- a/src/main/java/game/StartTicTacToeGame.java +++ b/src/main/java/game/StartTicTacToeGame.java @@ -32,7 +32,7 @@ public class StartTicTacToeGame implements ActionListener{ boolean player1Turn = true; boolean player2Turn = false; - static JLabel label = new JLabel(); + static JLabel TicTacToeLabel = new JLabel(); public StartTicTacToeGame() { @@ -45,12 +45,12 @@ public class StartTicTacToeGame implements ActionListener{ gui.Frame.getContentPane().setBackground(Color.BLACK); - label = new JLabel(); - label.setText("Tic-Tac-Toe"); - label.setForeground(Color.white); - label.setFont(new Font("arial", Font.PLAIN, 30)); - label.setBounds(320,20,500,50); - gui.Frame.add(label); + 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); fieldButton = new JButton(); fieldButton.setBackground(Color.white); @@ -334,8 +334,8 @@ public class StartTicTacToeGame implements ActionListener{ } public void player1WonTheGame() { - label.setText("Spieler 1 hat gewonnen."); - label.setBounds(250,20,500,50); + TicTacToeLabel.setText("Spieler 1 hat gewonnen."); + TicTacToeLabel.setBounds(250,20,500,50); fieldButton.setVisible(false); fieldButton2.setVisible(false); fieldButton3.setVisible(false); @@ -351,8 +351,8 @@ public class StartTicTacToeGame implements ActionListener{ } public void player2WonTheGame() { - label.setText("Spieler 2 hat gewonnen."); - label.setBounds(250,20,500,50); + TicTacToeLabel.setText("Spieler 2 hat gewonnen."); + TicTacToeLabel.setBounds(250,20,500,50); fieldButton.setVisible(false); fieldButton2.setVisible(false); fieldButton3.setVisible(false);