protected Graphics getGraphics(Component destination) {
    if (destination != null) {

      if (destination.getGraphics() != null) {
        return destination.getGraphics();
      } else {
        System.out.println("AWT component "+destination.getClass().getSimpleName()+" does not provide 2D graphics capabilities.");
        return null;
        //throw new IllegalArgumentException("AWT component "+destination.getClass().getSimpleName()+" does not provide 2D graphics capabilities.");
      }
    } else {
      throw new IllegalArgumentException("destination component cannot be null");
    }
  }
Get the graphics context of the given component.
@param destination the AWT component used for rendering (not null)
@return the graphics context of the given component.
jme3-desktop/src/main/java/com/jme3/system/AWTComponentRenderer.java