summaryrefslogtreecommitdiff
path: root/java/awt/Label.java
diff options
context:
space:
mode:
authorDavid Gilbert <david.gilbert@object-refinery.com>2006-06-27 15:33:48 +0000
committerDavid Gilbert <david.gilbert@object-refinery.com>2006-06-27 15:33:48 +0000
commitf4ce903ab06bf93776a935b6d66127247fd572b7 (patch)
tree1ca54566cc5052164a515a21b3f397a4512d7f9c /java/awt/Label.java
parentf1de28e5cc9a612ca73687141eb1f6e29c94b2fa (diff)
downloadclasspath-f4ce903ab06bf93776a935b6d66127247fd572b7.tar.gz
2006-06-27 David Gilbert <david.gilbert@object-refinery.com>
* java/awt/Component.java (setName): Fire required PropertyChangeEvent, * java/awt/Label.java (getText): Removed redundant brackets, (generateName): New method (override), (nextLabelNumber): New field, (getUniqueLong): New method.
Diffstat (limited to 'java/awt/Label.java')
-rw-r--r--java/awt/Label.java22
1 files changed, 21 insertions, 1 deletions
diff --git a/java/awt/Label.java b/java/awt/Label.java
index ca2c013ac..71614da64 100644
--- a/java/awt/Label.java
+++ b/java/awt/Label.java
@@ -167,7 +167,7 @@ public class Label extends Component implements Accessible
*/
public String getText()
{
- return(text);
+ return text;
}
/**
@@ -271,5 +271,25 @@ public class Label extends Component implements Accessible
return accessibleContext;
}
+ /**
+ * Generate a unique name for this button.
+ *
+ * @return A unique name for this button.
+ */
+ String generateName()
+ {
+ return "label" + getUniqueLong();
+ }
+
+ /**
+ * The number used to generate the name returned by getName.
+ */
+ private static transient long nextLabelNumber;
+
+ private static synchronized long getUniqueLong()
+ {
+ return nextLabelNumber++;
+ }
+
}