BasicListUI.this.list.addSelectionInterval(index,index);
list.addSelectionInterval(index,index);
    public void mouseClicked(MouseEvent event)    {      Point click = event.getPoint();      int index = BasicListUI.this.locationToIndex(list, click);      if (index == -1)        return;      if (event.isShiftDown())        {          if (BasicListUI.this.list.getSelectionMode() ==               ListSelectionModel.SINGLE_SELECTION)            BasicListUI.this.list.setSelectedIndex(index);          else if (BasicListUI.this.list.getSelectionMode() ==                    ListSelectionModel.SINGLE_INTERVAL_SELECTION)            // COMPAT: the IBM VM is compatible with the following line of code.            // However, compliance with Sun's VM would correspond to replacing             // getAnchorSelectionIndex() with getLeadSelectionIndex().This is             // both unnatural and contradictory to the way they handle other             // similar UI interactions.            BasicListUI.this.list.setSelectionInterval              (BasicListUI.this.list.getAnchorSelectionIndex(), index);          else            // COMPAT: both Sun and IBM are compatible instead with:            // BasicListUI.this.list.setSelectionInterval            //     (BasicListUI.this.list.getLeadSelectionIndex(),index);            // Note that for IBM this is contradictory to what they did in             // the above situation for SINGLE_INTERVAL_SELECTION.              // The most natural thing to do is the following:            BasicListUI.this.list.getSelectionModel().              setLeadSelectionIndex(index);        }      else if (event.isControlDown())        {          if (BasicListUI.this.list.getSelectionMode() ==               ListSelectionModel.SINGLE_SELECTION)            BasicListUI.this.list.setSelectedIndex(index);          else if (BasicListUI.this.list.isSelectedIndex(index))            BasicListUI.this.list.removeSelectionInterval(index,index);          else            BasicListUI.this.list.addSelectionInterval(index,index);        }      else        BasicListUI.this.list.setSelectedIndex(index);            BasicListUI.this.list.ensureIndexIsVisible        (BasicListUI.this.list.getLeadSelectionIndex());    }