super.setPopupSize(cbBounds.width, popupHeight);
Insets insets1 = getInsets(); Insets insets2 = scroller.getInsets(); super.setPopupSize(cbBounds.width, popupHeight + insets1.top + insets1.bottom + insets2.top + insets2.bottom);
  public void show()  {    Rectangle cbBounds = comboBox.getBounds();    // popup should have same width as the comboBox and should be hight anough    // to display number of rows equal to 'maximumRowCount' property    int popupHeight = getPopupHeightForRowCount(comboBox.getMaximumRowCount());    list.setPreferredSize(new Dimension(cbBounds.width, popupHeight));    super.setPopupSize(cbBounds.width, popupHeight);    // Highlight selected item in the combo box's drop down list    if (comboBox.getSelectedIndex() != -1)      list.setSelectedIndex(comboBox.getSelectedIndex());    //scroll scrollbar s.t. selected item is visible    JScrollBar scrollbar = scroller.getVerticalScrollBar();    int selectedIndex = comboBox.getSelectedIndex();    if (selectedIndex > comboBox.getMaximumRowCount())      scrollbar.setValue(getPopupHeightForRowCount(selectedIndex));    // location specified is relative to comboBox    super.show(comboBox, 0, cbBounds.height);  }