{
    public void intervalAdded(ListDataEvent e)    {      int start = e.getIndex0();      int end = e.getIndex1();      if (start == 0 && comboBox.getItemCount() - (end - start + 1) == 0)        {          contentsChanged(e);        }      else if (start != -1  || end != -1)        {      ListCellRenderer renderer = comboBox.getRenderer();          ComboBoxModel model = comboBox.getModel();          int w = displaySize.width;          int h = displaySize.height;          // TODO: Optimize using prototype here.          for (int i = start; i <= end; ++i)            {              Component comp =                renderer.getListCellRendererComponent(listBox,                                                      model.getElementAt(i),                                                      -1, false, false);              currentValuePane.add(comp);              comp.setFont(comboBox.getFont());              Dimension dim = comp.getPreferredSize();              w = Math.max(w, dim.width);              h = Math.max(h, dim.height);              currentValuePane.remove(comp);            }          if (displaySize.width < w || displaySize.height < h)            {              if (displaySize.width < w)                {                  displaySize.width = w;                }              if (displaySize.height < h)                {                  displaySize.height = h;                }              comboBox.revalidate();              if (editor != null)                {                  comboBox.configureEditor(comboBox.getEditor(),                                           comboBox.getSelectedItem());                }            }        }    }