summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Schuster <theBohemian@gmx.net>2005-07-15 12:57:38 +0000
committerRobert Schuster <theBohemian@gmx.net>2005-07-15 12:57:38 +0000
commit3e286d37df4be0fd8305a89c1b62b94697e6d9f5 (patch)
tree478461b41fa7b8b11bba03caa20676527ebbc0ab
parentee8622b2db7af1eb939e358dd599cca3adca0777 (diff)
downloadclasspath-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--ChangeLog5
-rw-r--r--javax/swing/AbstractButton.java8
2 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index eeb4c8843..7a6d1b431 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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();