This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
The moose likes Swing / AWT / SWT and the fly likes Mouse Event on Container Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "Mouse Event on Container" Watch "Mouse Event on Container" New topic
Author

Mouse Event on Container

Alec Lee
Ranch Hand

Joined: Jan 28, 2004
Posts: 569
I have a Component placed inside a Container. When I click on the component, is it only the Component that will receive a mouse event - not the Container? If true, how can I tell the Container that it is clicked?
Michael Dunn
Ranch Hand

Joined: Jun 09, 2003
Posts: 4632
if the component has any mouseListener added (tooltip etc) it will consume the event.
in that case you need to forward it to the container via dispatchEvent(...)
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Mouse Event on Container
 
It's not a secret anymore!