summaryrefslogtreecommitdiff
path: root/javax/swing/AbstractButton.java
diff options
context:
space:
mode:
authorRoman Kennke <roman@kennke.org>2005-07-15 11:41:05 +0000
committerRoman Kennke <roman@kennke.org>2005-07-15 11:41:05 +0000
commitcaaedaabb5f445a1826d804543ffefc68ef566c5 (patch)
tree424ee1e29e6714c63549f476bf75469ac0d0b720 /javax/swing/AbstractButton.java
parent349b866a445a60d9327414555ea9deff6c046ab5 (diff)
downloadclasspath-caaedaabb5f445a1826d804543ffefc68ef566c5.tar.gz
2005-07-15 Roman Kennke <roman@kennke.org>
* javax/swing/AbstractButton.java (AbstractButton): Directly call init() and updateUI(). (AbstractButton(String, Icon)): Removed. This is not necessary since we have init(String, Icon) for that purpose. (getActionCommand): Reverted to previous behaviour: If actionCommand is set, return this, otherwise return text, even if text is null. * javax/swing/JButton.java (JButton(String, Icon)): Call super() and init(String, Icon) instead of super(String, Icon). * javax/swing/JMenuItem.java (JMenuItem): Call super() instead of super(String, Icon). (JMenuItem(Icon)): Call this(String, Icon) instead of super(String, Icon). (JMenuItem(String)): Call this(String, Icon) instead of super(String, Icon). (JMenuItem(Action)): Call super() instead of super(String, Icon). (JMenuItem(String, Icon)): Call super() and init(String, Icon) instead of super(String, Icon). (JMenuItem(String, int)): Call this(String, Icon) instead of super(String, Icon). * javax/swing/JToggleButton.java (ToggleButtonModel.setPressed): Fire an ActionEvent if button is released. According to my Mauve tests, it seems that this is what the JDK does, so do we. (ToggleButtonModel.setSelected): Removed. (JToggleButton): Call super() and init(String, Icon) instead of super(String, Icon).
Diffstat (limited to 'javax/swing/AbstractButton.java')
-rw-r--r--javax/swing/AbstractButton.java17
1 files changed, 2 insertions, 15 deletions
diff --git a/javax/swing/AbstractButton.java b/javax/swing/AbstractButton.java
index 8984c633c..5aaf71651 100644
--- a/javax/swing/AbstractButton.java
+++ b/javax/swing/AbstractButton.java
@@ -517,18 +517,7 @@ public abstract class AbstractButton extends JComponent
*/
public AbstractButton()
{
- this("",null);
- }
-
- /**
- * Creates a new AbstractButton object.
- *
- * @param txt Value to use for the button's "text" property
- * @param icon Value to use for the button's "defaultIcon" property
- */
- AbstractButton(String txt, Icon icon)
- {
- init (txt, icon);
+ init("", null);
updateUI();
}
@@ -610,10 +599,8 @@ public abstract class AbstractButton extends JComponent
String ac = model.getActionCommand();
if (ac != null)
return ac;
- else if (text != null)
- return text;
else
- return "";
+ return text;
}
/**