code: public static boolean graphicAvailable() {
          synchronized (monitor) {
              if (!graphicAvailableChecked) {
                  String s = System.getProperty("SERVER");
                  if (s!=null && s.equals("true")) {
                      graphicIsAvailable = false;
                  }
                  else {
                      try {
                          graphicIsAvailable = !java.awt.GraphicsEnvironment.isHeadless();
                      }
                      catch(Error e) {
                          graphicIsAvailable = false;
                          //System.err.println(e + "\n" + "---------------> Graphics Environment not available");
                      }
                      catch(Exception e) {
                          graphicIsAvailable = false;
                          //System.err.println(e + "\n" + "---------------> Graphics Environment not available");
                      }
                  }
                  graphicAvailableChecked = true;
             }
          }
          return graphicIsAvailable;
      }
docs: ===================================================================