diff options
Diffstat (limited to 'libjava/java/awt/Menu.java')
-rw-r--r-- | libjava/java/awt/Menu.java | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libjava/java/awt/Menu.java b/libjava/java/awt/Menu.java index 35798a066df..3cc9cc301ae 100644 --- a/libjava/java/awt/Menu.java +++ b/libjava/java/awt/Menu.java @@ -451,12 +451,18 @@ paramString() } } - /* (non-Javadoc) - * @see java.awt.MenuComponent#getAccessibleContext() + /** + * Gets the AccessibleContext associated with this <code>Menu</code>. + * The context is created, if necessary. + * + * @return the associated context */ public AccessibleContext getAccessibleContext() { - return new AccessibleAWTMenu(); + /* Create the context if this is the first request */ + if (accessibleContext == null) + accessibleContext = new AccessibleAWTMenu(); + return accessibleContext; } } // class Menu |