Results 1 to 2 of 2
- 05-09-2010, 05:50 PM #1Member
- Join Date
- Apr 2010
- Rep Power
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.
Can you give a little more detail on what you're trying to do? Why do you want both the JScrollPane (or perhaps its viewport) and the contained JPanel to receive mouse events? What actions will be triggered in the scrollpane by the events and what actions in the JPanel? Can you post a small compilable program that demonstrates the set up as best you can?
- By j2me64 in forum Java 2DReplies: 3Last Post: 04-24-2010, 04:57 PM
- By david.stefka in forum AWT / SwingReplies: 3Last Post: 02-06-2010, 04:28 PM
- By Suurisa in forum New To JavaReplies: 2Last Post: 10-27-2009, 01:52 AM
- By sfaxianovic in forum New To JavaReplies: 2Last Post: 08-21-2008, 03:30 AM
- By Aswq in forum New To JavaReplies: 12Last Post: 07-18-2008, 08:10 AM