Given a JList like
JList myList = new JList(items);
the selected items in the list can be modified through the ListSelectionModel of the JList:
ListSelectionModel sm = myList.getSelectionModel();
sm.clearSelection(); // clears the selection
sm.setSelectionInterval(inde...