summaryrefslogtreecommitdiff
path: root/libjava/classpath/java/awt/AWTEvent.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/awt/AWTEvent.java')
-rw-r--r--libjava/classpath/java/awt/AWTEvent.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/libjava/classpath/java/awt/AWTEvent.java b/libjava/classpath/java/awt/AWTEvent.java
index 3f4027c2c05..102062cdfe6 100644
--- a/libjava/classpath/java/awt/AWTEvent.java
+++ b/libjava/classpath/java/awt/AWTEvent.java
@@ -262,9 +262,17 @@ public abstract class AWTEvent extends EventObject
*/
public String toString ()
{
+ String src;
+ if (source instanceof Component)
+ src = ((Component) source).getName();
+ else if (source instanceof MenuComponent)
+ src = ((MenuComponent) source).getName();
+ else if (source != null)
+ src = source.toString();
+ else
+ src = "null";
String string = getClass ().getName () + "[" + paramString () + "] on "
- + source;
-
+ + src;
return string;
}