public void setSize(int width, int height) {
   if (myViewBounds != null) {
     myViewBounds.setSize(width, height);
   } else {
     setBounds(null, new Dimension(width, height));
   }
 }
  /**
   * Put the properties of this component that shall be persisted at application exit to the
   * application {@link Config}
   */
  private void saveSettings() {
    GUI gUI = configuration.getgUI();

    Rectangle sizeAndLocation = gUI.getImageConflictViewer().getSizeAndLocation();

    sizeAndLocation.setLocation(this.getLocationOnScreen().x, this.getLocationOnScreen().y);
    sizeAndLocation.setSize(this.getSize().width, this.getSize().height);
  }
 private static Rectangle fitToScreen(
     @NotNull Dimension newDim, @NotNull RelativePoint popupPosition, JTable table) {
   Rectangle rectangle = new Rectangle(popupPosition.getScreenPoint(), newDim);
   ScreenUtil.fitToScreen(rectangle);
   if (rectangle.getHeight() != newDim.getHeight()) {
     int newHeight = (int) rectangle.getHeight();
     int roundedHeight = newHeight - newHeight % table.getRowHeight();
     rectangle.setSize((int) rectangle.getWidth(), Math.max(roundedHeight, table.getRowHeight()));
   }
   return rectangle;
 }