void (ListModel<LookupElement> model) { myList.setFixedCellHeight(myCellRenderer.getListCellRendererComponent(myList, model.getElementAt(0), 0, false, false).getPreferredSize().height); myList.setVisibleRowCount(Math.min(model.getSize(), myPresentation.getMaxVisibleItemsCount())); }