return displaySize; } return getDefaultSize();
return dim;
  protected Dimension getDisplaySize()  {    if (comboBox.isEditable() && comboBox.getModel().getSize() == 0)      return new Dimension(100, editor.getPreferredSize().height);    Dimension dim = new Dimension();    ListCellRenderer renderer = comboBox.getRenderer();    ComboBoxModel model = comboBox.getModel();    if (renderer != null && model.getSize() > 0)      {        // TODO: Optimize using prototype here.        int size = model.getSize();        for (int i = 0; i < size; ++i)          {            Component comp = renderer.getListCellRendererComponent              (listBox, model.getElementAt(i), -1, false, false);            currentValuePane.add(comp);            comp.setFont(comboBox.getFont());            Dimension renderSize = comp.getPreferredSize();            currentValuePane.remove(comp);            dim.width = Math.max(dim.width, renderSize.width);            dim.height = Math.max(dim.height, renderSize.height);  }        if (comboBox.isEditable())          {            Dimension editSize = editor.getPreferredSize();            dim.width = Math.max(dim.width, editSize.width);            dim.height = Math.max(dim.height, editSize.height);          }        displaySize.setSize(dim.width, dim.height);        return displaySize;      }    return getDefaultSize();  }