Tic-tac-toe game in Java