Browse Source

refactoring: renamed label to TicTacToeLabel

master
TRC9696 2 years ago
parent
commit
808702f7b8
  1. 22
      src/main/java/game/StartTicTacToeGame.java

22
src/main/java/game/StartTicTacToeGame.java

@ -32,7 +32,7 @@ public class StartTicTacToeGame implements ActionListener{
boolean player1Turn = true; boolean player1Turn = true;
boolean player2Turn = false; boolean player2Turn = false;
static JLabel label = new JLabel();
static JLabel TicTacToeLabel = new JLabel();
public StartTicTacToeGame() { public StartTicTacToeGame() {
@ -45,12 +45,12 @@ public class StartTicTacToeGame implements ActionListener{
gui.Frame.getContentPane().setBackground(Color.BLACK); 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 = new JButton();
fieldButton.setBackground(Color.white); fieldButton.setBackground(Color.white);
@ -334,8 +334,8 @@ public class StartTicTacToeGame implements ActionListener{
} }
public void player1WonTheGame() { 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); fieldButton.setVisible(false);
fieldButton2.setVisible(false); fieldButton2.setVisible(false);
fieldButton3.setVisible(false); fieldButton3.setVisible(false);
@ -351,8 +351,8 @@ public class StartTicTacToeGame implements ActionListener{
} }
public void player2WonTheGame() { 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); fieldButton.setVisible(false);
fieldButton2.setVisible(false); fieldButton2.setVisible(false);
fieldButton3.setVisible(false); fieldButton3.setVisible(false);

Loading…
Cancel
Save