private static Rectangle getScreenBoundaries(Component component) {
    if (component != null && !GraphicsEnvironment.isHeadless()) {
      try {
        return component.isShowing() ?
               component.getGraphicsConfiguration().getDevice().getDefaultConfiguration().getBounds() :
               GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getBounds();
      }
      catch (Exception e) {
        Logger.getInstance(JBCefOsrHandler.class).error(e);
      }
    }

    return new Rectangle(0, 0, 0, 0);
  }
private static Rectangle getScreenBoundaries(Component component)