public static boolean areGraphicsSafeToUse() {
		if (!GraphicsEnvironment.isHeadless()) {
			if (HEADLESS_CHECK_RESULT == 0) {
				// We do the following just in case we're in an X-Windows
				// environment without a valid DISPLAY device...
				try {
					GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
					HEADLESS_CHECK_RESULT = 1;
				} catch (Error error) {
					HEADLESS_CHECK_RESULT = 2;
				}
			}
			if (HEADLESS_CHECK_RESULT == 1) {
				return true;
			}
		}
		return false;
	}