CJCoding With Joseph
15free / daySign inCreate account

Mastering Java Swing

Cat's Game - STEP 7

Tic Tac Toe Game

In this section, we’ll add the logic to check if the game ends in a tie, also called a "Cat's Game."

We’ll create a method called isATie() that returns a boolean. This method will go through all the buttons on the board and check if any are still empty. If all buttons are filled and no one has won, it means the game is a tie:

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 27 more lessons in Mastering Java Swing.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.