Comparison of Icons
<p>I am trying to do the game called TicTacToe but now I am stopped on one point:</p>

<pre><code>private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {

    if (player==true){
        jButton1.setIcon(new javax.swing.ImageIcon("x2.png"));
        player=false;
    } else {
        jButton1.setIcon(new javax.swing.ImageIcon("o2.png"));
        player=true;
    }

    if (this.jButton1.getIcon()==this.jButton2.getIcon()){
        JOptionPane.showMessageDialog(null,"Win!");
    }
} 
</code></pre>

<p>I have done this for all buttons.</p>

<p>When I have these three buttons with the same icon, the message does not appear. Why?</p>
