@Override
    protected int getPopupHeightForRowCount(int maxRowCount) {
      int result = super.getPopupHeightForRowCount(maxRowCount);

      // Recalculate the minimum row height of a list cell, which is calculated in WideSelectionListUI.updateLayoutState
      int rowCount = Math.min(maxRowCount, comboBox.getItemCount());
      ListCellRenderer<Object> renderer = list.getCellRenderer();
      for (int i = 0; i < rowCount; i++) {
        Object value = list.getModel().getElementAt(i);
        Component c = renderer.getListCellRendererComponent(list, value, i, false, false);
        Dimension preferredSize = c.getPreferredSize();
        result -= preferredSize.height;
        result += UIUtil.updateListRowHeight(preferredSize).height;
      }

      return result;
    }
@Override
    protected int getPopupHeightForRowCount(int maxRowCount)