Mouselistener for a Jscrollpane which contains Jpanel within it.
I have JPanel contained inside Jscrollpane. I want to trap mouse events when user clicks anywhere on JScrollpane. I have implemented a mouselistener within JScrollpane class.
My problem is that the mouse events are not properly captured. Since Jpanel is inside the area of Jscrollpane, I expect that when I click on Jpanel Area, the Jscrollpane should receive the mouse events too. But it is not happening.
Is there a way to solve this problem? Please help.