|
@ -23,7 +23,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
public JTextField textFieldAusgabe2; |
|
|
public JTextField textFieldAusgabe2; |
|
|
public JTextField textFieldAusgabe3; |
|
|
public JTextField textFieldAusgabe3; |
|
|
|
|
|
|
|
|
public int spielerIstDran = 1; |
|
|
|
|
|
|
|
|
public int aktullerSpieler = 1; |
|
|
String btn1 = "0", btn2 = "0", btn3 = "0", btn4 = "0", btn5 = "0", btn6 = "0", btn7 = "0", btn8 = "0", btn9 = "0"; |
|
|
String btn1 = "0", btn2 = "0", btn3 = "0", btn4 = "0", btn5 = "0", btn6 = "0", btn7 = "0", btn8 = "0", btn9 = "0"; |
|
|
public String spieler1 = "Spieler 1 hat %d Punkte"; |
|
|
public String spieler1 = "Spieler 1 hat %d Punkte"; |
|
|
public String spieler2 = "Spieler 2 hat %d Punkte"; |
|
|
public String spieler2 = "Spieler 2 hat %d Punkte"; |
|
@ -150,7 +150,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButtonReset.addActionListener(new ActionListener() { |
|
|
btnNewButtonReset.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
textFieldAusgabe2.setText("Spieler 1: 0 Punkte"); |
|
|
textFieldAusgabe2.setText("Spieler 1: 0 Punkte"); |
|
|
textFieldAusgabe3.setText("Spieler 1: 0 Punkte"); |
|
|
textFieldAusgabe3.setText("Spieler 1: 0 Punkte"); |
|
@ -207,7 +207,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
btnNewButtonFeldSaubermachen.addActionListener(new ActionListener() { |
|
|
btnNewButtonFeldSaubermachen.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
|
|
|
|
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
|
|
|
|
|
|
btn1 = "0"; btn2 = "0"; btn3 = "0"; btn4 = "0"; btn5 = "0"; btn6 = "0"; btn7 = "0"; btn8 = "0"; btn9 = "0"; |
|
|
btn1 = "0"; btn2 = "0"; btn3 = "0"; btn4 = "0"; btn5 = "0"; btn6 = "0"; btn7 = "0"; btn8 = "0"; btn9 = "0"; |
|
@ -259,7 +259,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton1.addActionListener(new ActionListener() { |
|
|
btnNewButton1.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton1.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton1.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton1.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton1.setBackground(new Color(255, 0, 0)); |
|
|
btn1 = "red"; |
|
|
btn1 = "red"; |
|
@ -281,10 +281,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton1.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton1.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton1.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton1.setBackground(new Color(0, 0, 255)); |
|
|
btn1 = "blue"; |
|
|
btn1 = "blue"; |
|
@ -307,7 +307,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -318,7 +318,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton2.addActionListener(new ActionListener() { |
|
|
btnNewButton2.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton2.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton2.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton2.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton2.setBackground(new Color(255, 0, 0)); |
|
|
btn2 = "red"; |
|
|
btn2 = "red"; |
|
@ -340,10 +340,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton2.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton2.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton2.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton2.setBackground(new Color(0, 0, 255)); |
|
|
btn2 = "blue"; |
|
|
btn2 = "blue"; |
|
@ -365,7 +365,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -376,7 +376,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton3.addActionListener(new ActionListener() { |
|
|
btnNewButton3.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton3.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton3.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton3.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton3.setBackground(new Color(255, 0, 0)); |
|
|
btn3 = "red"; |
|
|
btn3 = "red"; |
|
@ -399,10 +399,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton3.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton3.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton3.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton3.setBackground(new Color(0, 0, 255)); |
|
|
btn3 = "blue"; |
|
|
btn3 = "blue"; |
|
@ -425,7 +425,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -436,7 +436,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton4.addActionListener(new ActionListener() { |
|
|
btnNewButton4.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton4.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton4.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton4.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton4.setBackground(new Color(255, 0, 0)); |
|
|
btn4 = "red"; |
|
|
btn4 = "red"; |
|
@ -458,10 +458,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton4.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton4.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton4.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton4.setBackground(new Color(0, 0, 255)); |
|
|
btn4 = "blue"; |
|
|
btn4 = "blue"; |
|
@ -483,7 +483,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -494,7 +494,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton5.addActionListener(new ActionListener() { |
|
|
btnNewButton5.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton5.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton5.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton5.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton5.setBackground(new Color(255, 0, 0)); |
|
|
btn5 = "red"; |
|
|
btn5 = "red"; |
|
@ -518,10 +518,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton5.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton5.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton5.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton5.setBackground(new Color(0, 0, 255)); |
|
|
btn5 = "blue"; |
|
|
btn5 = "blue"; |
|
@ -545,7 +545,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -556,7 +556,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton6.addActionListener(new ActionListener() { |
|
|
btnNewButton6.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton6.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton6.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton6.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton6.setBackground(new Color(255, 0, 0)); |
|
|
btn6 = "red"; |
|
|
btn6 = "red"; |
|
@ -578,10 +578,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton6.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton6.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton6.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton6.setBackground(new Color(0, 0, 255)); |
|
|
btn6 = "blue"; |
|
|
btn6 = "blue"; |
|
@ -603,7 +603,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -614,7 +614,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton7.addActionListener(new ActionListener() { |
|
|
btnNewButton7.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton7.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton7.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton7.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton7.setBackground(new Color(255, 0, 0)); |
|
|
btn7 = "red"; |
|
|
btn7 = "red"; |
|
@ -637,10 +637,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton7.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton7.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton7.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton7.setBackground(new Color(0, 0, 255)); |
|
|
btn7 = "blue"; |
|
|
btn7 = "blue"; |
|
@ -663,7 +663,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -674,7 +674,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton8.addActionListener(new ActionListener() { |
|
|
btnNewButton8.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton8.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton8.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton8.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton8.setBackground(new Color(255, 0, 0)); |
|
|
btn8 = "red"; |
|
|
btn8 = "red"; |
|
@ -696,10 +696,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton8.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton8.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton8.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton8.setBackground(new Color(0, 0, 255)); |
|
|
btn8 = "blue"; |
|
|
btn8 = "blue"; |
|
@ -721,7 +721,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -732,7 +732,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
|
|
|
|
|
|
btnNewButton9.addActionListener(new ActionListener() { |
|
|
btnNewButton9.addActionListener(new ActionListener() { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
public void actionPerformed(ActionEvent e) { |
|
|
if(spielerIstDran == 1) { |
|
|
|
|
|
|
|
|
if(aktullerSpieler == 1) { |
|
|
btnNewButton9.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton9.setForeground(new Color(255, 0, 0)); |
|
|
btnNewButton9.setBackground(new Color(255, 0, 0)); |
|
|
btnNewButton9.setBackground(new Color(255, 0, 0)); |
|
|
btn9 = "red"; |
|
|
btn9 = "red"; |
|
@ -755,10 +755,10 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 2 ist dran."); |
|
|
spielerIstDran = 2; |
|
|
|
|
|
|
|
|
aktullerSpieler = 2; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end if |
|
|
}//end if |
|
|
else if(spielerIstDran == 2){ |
|
|
|
|
|
|
|
|
else if(aktullerSpieler == 2){ |
|
|
btnNewButton9.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton9.setForeground(new Color(0, 0, 255)); |
|
|
btnNewButton9.setBackground(new Color(0, 0, 255)); |
|
|
btnNewButton9.setBackground(new Color(0, 0, 255)); |
|
|
btn9 = "blue"; |
|
|
btn9 = "blue"; |
|
@ -781,7 +781,7 @@ public class TikTakToeGame extends JFrame{ |
|
|
}//end if |
|
|
}//end if |
|
|
else { |
|
|
else { |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
TextFieldAusgabe1.setText("Der Spieler 1 ist dran."); |
|
|
spielerIstDran = 1; |
|
|
|
|
|
|
|
|
aktullerSpieler = 1; |
|
|
}//end else |
|
|
}//end else |
|
|
}//end else if |
|
|
}//end else if |
|
|
else { |
|
|
else { |
|
@ -834,12 +834,12 @@ public class TikTakToeGame extends JFrame{ |
|
|
this.textFieldAusgabe3 = textFieldAusgabe3; |
|
|
this.textFieldAusgabe3 = textFieldAusgabe3; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public int getSpielerIstDran() { |
|
|
|
|
|
return spielerIstDran; |
|
|
|
|
|
|
|
|
public int getaktullerSpieler() { |
|
|
|
|
|
return aktullerSpieler; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public void setSpielerIstDran(int spielerIstDran) { |
|
|
|
|
|
this.spielerIstDran = spielerIstDran; |
|
|
|
|
|
|
|
|
public void setaktullerSpieler(int aktullerSpieler) { |
|
|
|
|
|
this.aktullerSpieler = aktullerSpieler; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public String getBtn1() { |
|
|
public String getBtn1() { |
|
|