wood burning stoves 2.0*
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


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(...)
 
GeeCON Prague 2014
 
subject: Mouse Event on Container