Checking for winner in tic tac toe
<pre><code>/** Set Winning Possobilites (X Represents Not Selected, and * represents Selected) */

    /** "*XX" "*XX" "*XX" */
    if (b1.getText().equals(b4.getText()) &amp;&amp; b4.getText().equals(b7.getText())) {
        congrats.setVisible(true);
    }
    {
    /** "#*#" "#*#" "#*#" */
    if (b2.getText().equals(b5.getText()) &amp;&amp; b5.getText().equals(b8.getText())) {
        congrats.setVisible(true);
    }else 
    /** "##*" "##*" "##*" */
    if (b3.getText().equals(b6.getText()) &amp;&amp; b6.getText().equals(b9.getText())) {
        congrats.setVisible(true);
    }else 
    // "***" "###" "###" */
    if (b7.getText().equals(b8.getText()) &amp;&amp; b8.getText().equals(b9.getText())) {
        congrats.setVisible(true);
    }else
    /** "XXX" "***" "XXX" */
    if (b4.getText().equals(b5.getText()) &amp;&amp; b5.getText().equals(b6.getText())) {
        congrats.setVisible(true);
    }else
    /** "XXX" "XXX" "***" */
    if (b1.getText().equals(b2.getText()) &amp;&amp; b2.getText().equals(b3.getText())) {
        congrats.setVisible(true);
    }else
    /** "*XX" "X*X" "XX*" */
    if (b7.getText().equals(b5.getText()) &amp;&amp; b5.getText().equals(b3.getText())) {
        congrats.setVisible(true);
    }else
    /** "XX*" "X*X" "*XX" */
    if (b1.getText().equals(b5.getText()) &amp;&amp; b5.getText().equals(b9.getText())) {
        congrats.setVisible(true);

    }
</code></pre>

<p>This is the code to check for a winner in my tic tac toe</p>

<p>The code doesn't work if i do not have the buttons starting of having some sort of text already in them, got any ideas?</p>
