ComboBoxModel model = comboBox.getModel(); ListCellRenderer renderer = comboBox.getRenderer();  if (displaySize == null) displaySize = getDisplaySize(); if (displaySize.width < getDefaultSize().width) displaySize.width = getDefaultSize().width; if (displaySize.height < getDefaultSize().height) displaySize.height = getDefaultSize().height;  comboBox.repaint();
    public void intervalAdded(ListDataEvent e)    {      // Lets assume every change invalidates the minimumsize.      isMinimumSizeDirty = true;      ComboBoxModel model = comboBox.getModel();      ListCellRenderer renderer = comboBox.getRenderer();      if (displaySize == null)        displaySize = getDisplaySize();      if (displaySize.width < getDefaultSize().width)        displaySize.width = getDefaultSize().width;      if (displaySize.height < getDefaultSize().height)        displaySize.height = getDefaultSize().height;      comboBox.repaint();    }