code: protected final void checkMaxSize(final Dimension screenSize,
              final Dimension frameSize) {
          if (frameSize.height > screenSize.height) {
              frameSize.height = screenSize.height;
          }
          if (frameSize.width > screenSize.width) {
              frameSize.width = screenSize.width;
          }
      }
docs: Adjusts the width and height of the fraem if it's greater than the
  screen.
  
  @param screenSize Screen size.
  @param frameSize Frame size.