if (e.getIndex0() != -1 || e.getIndex1() != -1) {
    public void contentsChanged(ListDataEvent e)    {      // if the item is selected or deselected      // Lets assume every change invalidates the minimumsize.      isMinimumSizeDirty = true;    }