title: Java - Boolean state not changing
body: <p>I've got this code here:</p>
  
  <pre><code>if ( event.getSource() == Square0 ) 
          {
  
              if ( PlayerOneTurn == true ) Square0.setBackground(Color.red);
              if ( PlayerOneTurn == true ) PlayerOneTurn = false ;
  
              if ( PlayerOneTurn == false ) Square0.setBackground(Color.blue) ;
  
          }
  </code></pre>
  
  <p>If it's not clear, I want the background to turn red and the state of PlayerOneTurn to change to false, so then it changes blue when I click it again.
  It works but <code>if ( PlayerOneTurn == true ) PlayerOneTurn = false ;</code> doesn't seem to change the value of the variable.
  Am I using completely the wrong statement or missing something out?</p>