In AbstractButton.init() we should call setText() instead of text = ...,
so that listeners on that property (especially in the UI) get notified
correctly.

2006-06-21  Roman Kennke  <[EMAIL PROTECTED]>

        * javax/swing/AbstractButton.java
        (init): Call setText() instead of setting the property directly,
        so that listeners (especially in the UI) get notified.

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
Index: javax/swing/AbstractButton.java
===================================================================
RCS file: /cvsroot/classpath/classpath/javax/swing/AbstractButton.java,v
retrieving revision 1.60
diff -u -1 -0 -r1.60 AbstractButton.java
--- javax/swing/AbstractButton.java	15 Jun 2006 17:37:05 -0000	1.60
+++ javax/swing/AbstractButton.java	21 Jun 2006 12:28:29 -0000
@@ -916,21 +916,21 @@
     repaint();
   }
 
  protected void init(String text, Icon icon) 
  {
     // If text is null, we fall back to the empty
     // string (which is set using AbstractButton's
     // constructor).
     // This way the behavior of the JDK is matched.
     if(text != null)
-        this.text = text;
+      setText(text);
 
     if (icon != null)
       default_icon = icon;
  }
  
   /**
    * <p>Returns the action command string for this button's model.</p>
    *
    * <p>If the action command was set to <code>null</code>, the button's
    * text (label) is returned instead.</p>

Attachment: signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil

Reply via email to