code: protected int getScreenResolution(Component c) {
          if (c == null) {
              return getDefaultScreenResolution();
          }
  
          Toolkit toolkit = c.getToolkit();
          return toolkit != null
                  ? toolkit.getScreenResolution()
                  : getDefaultScreenResolution();
      }
docs: Returns the components screen resolution or the default screen resolution if the component is
  null or has no toolkit assigned yet.
  
  @param c the component to ask for a toolkit
  @return the component's screen resolution