diff options
author | Robert Schuster <theBohemian@gmx.net> | 2005-07-15 12:57:38 +0000 |
---|---|---|
committer | Robert Schuster <theBohemian@gmx.net> | 2005-07-15 12:57:38 +0000 |
commit | 3e286d37df4be0fd8305a89c1b62b94697e6d9f5 (patch) | |
tree | 478461b41fa7b8b11bba03caa20676527ebbc0ab | |
parent | ee8622b2db7af1eb939e358dd599cca3adca0777 (diff) | |
download | classpath-3e286d37df4be0fd8305a89c1b62b94697e6d9f5.tar.gz |
The final fix for today to achieve maximum JDK-like Swing behavior. :)
2005-07-15 Robert Schuster <robertschuster@fsfe.org>
* javax/swing/AbstractButton.java:
(init): Do not change field text if argument text is null.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | javax/swing/AbstractButton.java | 8 |
2 files changed, 12 insertions, 1 deletions
@@ -1,3 +1,8 @@ +2005-07-15 Robert Schuster <robertschuster@fsfe.org> + + * javax/swing/AbstractButton.java: + (init): Do not change field text if argument text is null. + 2005-07-15 Mark Wielaard <mark@klomp.org> * java/util/logging/Logger.java (getCallerStackFrame): diff --git a/javax/swing/AbstractButton.java b/javax/swing/AbstractButton.java index 5aaf71651..0b5859bf5 100644 --- a/javax/swing/AbstractButton.java +++ b/javax/swing/AbstractButton.java @@ -564,7 +564,13 @@ public abstract class AbstractButton extends JComponent protected void init(String text, Icon icon) { - this.text = text; + // 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; + default_icon = icon; actionListener = createActionListener(); changeListener = createChangeListener(); |