diff options
Diffstat (limited to 'libjava/java/awt/Button.java')
-rw-r--r-- | libjava/java/awt/Button.java | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/libjava/java/awt/Button.java b/libjava/java/awt/Button.java index 86cb37cac90..0458ebbd71d 100644 --- a/libjava/java/awt/Button.java +++ b/libjava/java/awt/Button.java @@ -47,7 +47,6 @@ import java.util.EventListener; import javax.accessibility.Accessible; import javax.accessibility.AccessibleAction; import javax.accessibility.AccessibleContext; -import javax.accessibility.AccessibleRelation; import javax.accessibility.AccessibleRole; import javax.accessibility.AccessibleValue; @@ -429,9 +428,18 @@ paramString() + getWidth () + "x" + getHeight () + ",label=" + getLabel (); } +/** + * Gets the AccessibleContext associated with this <code>Button</code>. + * The context is created, if necessary. + * + * @return the associated context + */ public AccessibleContext getAccessibleContext() { - return new AccessibleAWTButton(); + /* Create the context if this is the first request */ + if (accessibleContext == null) + accessibleContext = new AccessibleAWTButton(); + return accessibleContext; } /** |