summaryrefslogtreecommitdiff
path: root/libjava/classpath/java/awt/Toolkit.java
diff options
context:
space:
mode:
Diffstat (limited to 'libjava/classpath/java/awt/Toolkit.java')
-rw-r--r--libjava/classpath/java/awt/Toolkit.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/libjava/classpath/java/awt/Toolkit.java b/libjava/classpath/java/awt/Toolkit.java
index c7c6f9f0ecb..2ca88b6f598 100644
--- a/libjava/classpath/java/awt/Toolkit.java
+++ b/libjava/classpath/java/awt/Toolkit.java
@@ -790,6 +790,9 @@ public abstract class Toolkit
{
// Presumably the only reason this isn't abstract is for backwards
// compatibility? FIXME?
+ if (GraphicsEnvironment.isHeadless())
+ throw new HeadlessException("No custom cursor in an headless graphics "
+ + "environment.");
return null;
}
@@ -801,6 +804,9 @@ public abstract class Toolkit
*/
public Dimension getBestCursorSize(int preferredWidth, int preferredHeight)
{
+ if (GraphicsEnvironment.isHeadless())
+ throw new HeadlessException("No best cursor size in an headless "
+ + "graphics environment.");
return new Dimension (0,0);
}