code: protected static GraphicsConfiguration getDefGC ()
      {
          if (_gc == null) {
              // obtain information on our graphics environment
              try {
                  GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment();
                  GraphicsDevice gd = env.getDefaultScreenDevice();
                  _gc = gd.getDefaultConfiguration();
              } catch (HeadlessException e) {
                  // no problem, just return null
              }
          }
          return _gc;
      }
docs: Obtains the default graphics configuration for this VM. If the JVM is in headless mode,
  this method will return null.