diff options
Diffstat (limited to 'java/awt/MenuBar.java')
-rw-r--r-- | java/awt/MenuBar.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/java/awt/MenuBar.java b/java/awt/MenuBar.java index 3cf708cd5..6737d0419 100644 --- a/java/awt/MenuBar.java +++ b/java/awt/MenuBar.java @@ -60,10 +60,15 @@ public class MenuBar extends MenuComponent implements MenuContainer, Serializable, Accessible { -//Serialization Constant + // Serialization Constant private static final long serialVersionUID = -4930327919388951260L; /** + * The number used to generate the name returned by getName. + */ + private static transient long next_menubar_number; + + /** * @serial The menu used for providing help information */ private Menu helpMenu; @@ -331,6 +336,21 @@ public class MenuBar extends MenuComponent accessibleContext = new AccessibleAWTMenuBar(); return accessibleContext; } + + /** + * Generate a unique name for this <code>MenuBar</code>. + * + * @return A unique name for this <code>MenuBar</code>. + */ + String generateName() + { + return "menubar" + getUniqueLong(); + } + + private static synchronized long getUniqueLong() + { + return next_menubar_number++; + } /** * This class provides accessibility support for AWT menu bars. |