summaryrefslogtreecommitdiff
path: root/javax/swing/AbstractButton.java
diff options
context:
space:
mode:
Diffstat (limited to 'javax/swing/AbstractButton.java')
-rw-r--r--javax/swing/AbstractButton.java32
1 files changed, 2 insertions, 30 deletions
diff --git a/javax/swing/AbstractButton.java b/javax/swing/AbstractButton.java
index f6aec1623..d7328c2a2 100644
--- a/javax/swing/AbstractButton.java
+++ b/javax/swing/AbstractButton.java
@@ -444,34 +444,6 @@ public abstract class AbstractButton extends JComponent
}
/**
- * Helper class used to subscribe to FocusEvents received by the button.
- */
- private class ButtonFocusListener implements FocusListener
- {
- /**
- * Possibly repaint the model in response to loss of focus.
- *
- * @param event The loss-of-focus event
- */
- public void focusLost(FocusEvent event)
- {
- if (AbstractButton.this.isFocusPainted())
- AbstractButton.this.repaint();
- }
-
- /**
- * Possibly repaint the button in response to acquisition of focus.
- *
- * @param event The gained-focus event
- */
- public void focusGained(FocusEvent event)
- {
- if (AbstractButton.this.isFocusPainted())
- AbstractButton.this.repaint();
- }
- }
-
- /**
* Creates a new AbstractButton object.
*/
public AbstractButton()
@@ -552,12 +524,12 @@ public abstract class AbstractButton extends JComponent
borderPainted = true;
contentAreaFilled = true;
- iconTextGap = 4;
+ focusPainted = true;
+ setFocusable(true);
setAlignmentX(LEFT_ALIGNMENT);
setAlignmentY(CENTER_ALIGNMENT);
- addFocusListener(new ButtonFocusListener());
setDisplayedMnemonicIndex(-1);
}