In the mouseClicked function it is used as the source of the event the list's cell, not the checkbox. So if you click the part of the cell which is situated outside the checkbox - the latter becomes selected, and this is not convenient for me. I render(in my application) a JPanel which has in one corner a little checkbox. I need the check box to be selected only when I click on it, not on another element which lies on the panel, let's say an image, etc.
I've tried to retain a Vector of checkboxes(the very ones which are rendered in the cells) and to add MouseListeners to each checkbox, but I can't "obtain" them in the handler, because they are subcomponents of the list. So this:
will print something like that(I've added also a MouseEvent to the list):