@Override
  protected void updateLayoutState() {
    if (list.getLayoutOrientation() != JList.VERTICAL) {
      super.updateLayoutState();
      return;
    }

    // pasted from BasicListUI to provide min-height
    int fixedCellHeight = list.getFixedCellHeight();
    int fixedCellWidth = list.getFixedCellWidth();
    cellWidth = fixedCellWidth;
    if (fixedCellHeight != -1) {
      cellHeight = fixedCellHeight;
      cellHeights = null;
    }
    else {
      cellHeight = -1;
      cellHeights = new int[list.getModel().getSize()];
    }
    if ((fixedCellWidth == -1) || (fixedCellHeight == -1)) {
      ListModel<Object> dataModel = list.getModel();
      int dataModelSize = dataModel.getSize();
      ListCellRenderer<Object> renderer = list.getCellRenderer();
      if (renderer != null) {
        for (int index = 0; index < dataModelSize; index++) {
          Object value = dataModel.getElementAt(index);
          Component c = renderer.getListCellRendererComponent(list, value, index, false, false);
          rendererPane.add(c);
          Dimension cellSize = c.getPreferredSize();
          if (UIUtil.getClientProperty(c, JBList.IGNORE_LIST_ROW_HEIGHT) == null) {
            cellSize = UIUtil.updateListRowHeight(cellSize);
          }
          if (fixedCellWidth == -1) {
            cellWidth = Math.max(cellSize.width, cellWidth);
          }
          if (fixedCellHeight == -1) {
            cellHeights[index] = cellSize.height;
          }
        }
      }
      else {
        if (cellWidth == -1) {
          cellWidth = 0;
        }
        if (cellHeights == null) {
          cellHeights = new int[dataModelSize];
        }
        for (int index = 0; index < dataModelSize; index++) {
          cellHeights[index] = 0;
        }
      }
    }
  }
@Override
  protected void updateLayoutState()