Comparing strings in a Textbox
<p>I would like to compare the string in a textbox if it contains "per/kg" and use that to disable a button. I have tried several methods but it did not work please kindly help out.</p>

<pre><code>if (productDescTextBox.getText().equals("per/kg"))
    {
        buttonDot.setEnabled(true);
    }
    else buttonDot.setEnabled(false);
</code></pre>

<p>and this </p>

<pre><code>if ("per/kg".equals(productDescTextBox.getText().toString()))
    {
        buttonDot.setEnabled(true);
    }
    else buttonDot.setEnabled(false);
</code></pre>
