Java toggle button event not fired when selection is done but fired when mouse hovered
<p>I have a toggle button and I set its state as follows</p>

<pre><code> public void setSizeFeet(boolean enabled) {
        this.size_tb.setSelected(enabled);

   } 
</code></pre>

<p>I have listener</p>

<pre><code>size_tb.addChangeListener(new javax.swing.event.ChangeListener() {
        public void stateChanged(javax.swing.event.ChangeEvent evt) {
            size_tbStateChanged(evt);
        }
    });
private void size_tbStateChanged(javax.swing.event.ChangeEvent evt) {                                     
     if (size_tb.isSelected()){
            size_tb.setText("Feet");
        } else {
            size_tb.setText("Meters");
        }
}    
</code></pre>

<p>The problem that when I set the state calling the first method. Nothing happens. However, by just hovering the mouse over the button then it updates to show the correct text. I put a break a point and I noticed the event just fires when I hover the mouse over the button. Shouldn't it when the selection is set or when it is mouse click not hover)</p>

<p>Thanks</p>