|
|
@ -22,15 +22,19 @@ public class cell extends JButton { |
|
|
|
} |
|
|
|
|
|
|
|
protected void OnMouseClick() { |
|
|
|
value = ttt.player; |
|
|
|
ttt.endTurn(); |
|
|
|
switch (value) { |
|
|
|
case 1: setBackground(new Color(255,0,0)); |
|
|
|
break; |
|
|
|
case 2: setBackground(new Color(0,0,255)); |
|
|
|
break; |
|
|
|
default: ; |
|
|
|
break; |
|
|
|
if(value == 0) { |
|
|
|
value = ttt.player; |
|
|
|
ttt.endTurn(); |
|
|
|
setEnabled(false); |
|
|
|
|
|
|
|
switch (value) { |
|
|
|
case 1: setBackground(new Color(255,0,0)); |
|
|
|
break; |
|
|
|
case 2: setBackground(new Color(0,0,255)); |
|
|
|
break; |
|
|
|
default: ; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|