I'm using a JScrollPane that contains a number of JPanels. These JPanels are selectable, and if one is double clicked on a MouseEvent is generated and is handled by the following method:
My problem is as follows. If I have many panels in the JScrollPane, and I scroll to the bottom and select one, the one that is selected is not the one I clicked on, but instead the bottom one that is visible in the JScrollpane if I scroll all the way to the top. Is there a way to correct this? It seems that in the above method, the Point being calculated is always in the original view space, instead of being the point that is found further down the JScrollPane.
Thanks for any help.