I have a JList with a JScrollPane. If I only have one thing in the JList, there will be empty space due to the JScrollPane. If I click anywhere in the JList, it will click the one element. Is there a way to make it only click the element if I actually click it? Also, I am using a custom renderer for the JList to add images, if that has anything to do with it.
Thanks
You can check the index that was clicked via
locationToIndex.