aspose file tools*
The moose likes Swing / AWT / SWT and the fly likes JPanel consuming Mouse Input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JPanel consuming Mouse Input" Watch "JPanel consuming Mouse Input" New topic
Author

JPanel consuming Mouse Input

Chris Nash
Greenhorn

Joined: May 20, 2009
Posts: 28
I have a JPanel (A) that the user can grab and move around. I have other JPanels (Bs) that are peers to A (they are aggregated in the same parent JPanel as A). Bs are MouseListeners that want to know when the mouse enters or exits them. When A is dragged over a B, the B doesn't get mouse input. They only get mouse input if A is moved off of them. I still want the Bs to get mouse input, whether or not A is on top of them (Bs are about the same size as A, so A covers them). Is there a simple API call that I can get to "push" mouse input down to the JPanel below? I can think of several ugly work-arounds, but none are elegant. TIA!


- Frecklefoot
"What you are good at is not as important as being good at something." --Robert B.Parker
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
Is there a simple API call that I can get to "push" mouse input down to the JPanel below?

dispatchEvent()
Chris Nash
Greenhorn

Joined: May 20, 2009
Posts: 28
Thank you!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JPanel consuming Mouse Input
 
Similar Threads
Custom JComponent
Using Custom Cursors
Movable JPanel - How?
Tab Order
paintComponent JPanel