@Override
		public void mouseClicked(MouseEvent e) {
			if (e.getClickCount() != 1) {
				return;
			}

			JList<?> list = (JList<?>) e.getSource();
			int index = list.locationToIndex(e.getPoint());
			if (index < 0) {
				return;
			}
			boolean selected = checkboxes[index].isSelected();
			checkboxes[index].setSelected(!selected);
			// The following repaint() is to get the check box state to get refreshed on the screen.
			// Prior to adding this the check box did not refresh the display of its state in the
			// list when selected multiple times in a row. It only seemed to repaint when focus 
			// was lost.
			list.repaint();
		}
Mouse listener to get the selected cell in the list.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/datatree/DomainFilesPanel.java