aboutsummaryrefslogtreecommitdiff
path: root/libjava/java/awt/Window.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/java/awt/Window.java')
-rw-r--r--libjava/java/awt/Window.java20
1 files changed, 20 insertions, 0 deletions
diff --git a/libjava/java/awt/Window.java b/libjava/java/awt/Window.java
index cdcd1a4..0a39d20 100644
--- a/libjava/java/awt/Window.java
+++ b/libjava/java/awt/Window.java
@@ -92,6 +92,11 @@ public class Window extends Container implements Accessible
private transient Component windowFocusOwner;
+ /*
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long next_window_number;
+
protected class AccessibleAWTWindow extends AccessibleAWTContainer
{
public AccessibleRole getAccessibleRole()
@@ -945,4 +950,19 @@ public class Window extends Container implements Accessible
getToolkit().getSystemEventQueue().postEvent(ce);
}
}
+
+ /**
+ * Generate a unique name for this window.
+ *
+ * @return A unique name for this window.
+ */
+ String generateName()
+ {
+ return "win" + getUniqueLong();
+ }
+
+ private static synchronized long getUniqueLong()
+ {
+ return next_window_number++;
+ }
}