A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Swing / AWT / SWT
Mouse Event on Container
Joined: Jan 28, 2004
Jan 28, 2010 02:45:16
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?
Joined: Jun 09, 2003
Jan 28, 2010 02:58:26
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:
subject: Mouse Event on Container
MouseEvent.getX()/getY() Returning Negative Value
Problem on Drawing line
Current mouse location...
Basic Concepts of AWT Event Generation
Getting current mouse position
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014