else 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)      BasicListUI.this.list.setSelectionInterval (BasicListUI.this.list.getAnchorSelectionIndex(), index); else       BasicListUI.this.list.getSelectionModel(). setLeadSelectionIndex(index); }
    public void mouseClicked(MouseEvent event)    {      Point click = event.getPoint();      int index = BasicListUI.this.locationToIndex(list, click);      if (index == -1)        return;      boolean controlPressed = event.isControlDown();      if (controlPressed)        {          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);    }