aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKevin Rushforth <[email protected]>2004-09-13 22:11:50 +0000
committerKevin Rushforth <[email protected]>2004-09-13 22:11:50 +0000
commit1550c521edcbbd02d0c5a991292d8ff0b394f381 (patch)
treef5b59e26b1ccef1c27864bfed6c3cc808baaabe7 /src
parent358fb7a6c30c5bad47b8cdfcc38685f635db46bb (diff)
Throw HeadlessException if isHeadless() is true. This avoids a
cryptic error message from MasterControl.loadLibraries(). git-svn-id: https://svn.java.net/svn/j3d-core~svn/trunk@37 ba19aa83-45c5-6ac9-afd3-db810772062c
Diffstat (limited to 'src')
-rw-r--r--src/classes/share/javax/media/j3d/VirtualUniverse.java7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/classes/share/javax/media/j3d/VirtualUniverse.java b/src/classes/share/javax/media/j3d/VirtualUniverse.java
index 776026c..35b1d69 100644
--- a/src/classes/share/javax/media/j3d/VirtualUniverse.java
+++ b/src/classes/share/javax/media/j3d/VirtualUniverse.java
@@ -242,6 +242,13 @@ public class VirtualUniverse extends Object {
System.err.println();
}
+ // Java 3D cannot run in headless mode, so we will throw a
+ // HeadlessException if isHeadless() is true. This avoids a
+ // cryptic error message from MasterControl.loadLibraries().
+ if (java.awt.GraphicsEnvironment.isHeadless()) {
+ throw new java.awt.HeadlessException();
+ }
+
// Load the native libraries and create the static
// MasterControl object
MasterControl.loadLibraries();