@Override
		public void mouseClicked(MouseEvent e) {

			clearStatusText();
			JList<?> list = (JList<?>) e.getSource();
			int index = list.locationToIndex(e.getPoint());
			if (index < 0) {
				return;
			}

			if (!saveable[index]) {
				setStatusText(
					files.get(index).getPathname() + " cannot be saved to current location");
				return;
			}
			boolean selected = checkboxes[index].isSelected();
			checkboxes[index].setSelected(!selected);
			listPanel.repaint();
		}
Mouse listener to get the selected cell in the list.
Ghidra/Framework/Project/src/main/java/ghidra/framework/main/SaveDataDialog.java