Results 1 to 2 of 2
- 05-09-2010, 05:50 PM #1
Member
- Join Date
- Apr 2010
- Posts
- 13
- Rep Power
- 0
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?
Similar Threads
-
can't get x and y from mouselistener
By j2me64 in forum Java 2DReplies: 3Last Post: 04-24-2010, 04:57 PM -
Dynamically changing JPanel in a JScrollPane - incorrect sizing
By david.stefka in forum AWT / SwingReplies: 3Last Post: 02-06-2010, 03:28 PM -
MouseListener & GUI
By Suurisa in forum New To JavaReplies: 2Last Post: 10-27-2009, 12:52 AM -
i need help for MouseListener
By sfaxianovic in forum New To JavaReplies: 2Last Post: 08-21-2008, 03:30 AM -
MouseListener
By Aswq in forum New To JavaReplies: 12Last Post: 07-18-2008, 08:10 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks