A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Win a copy of
OCM Java EE 6 Enterprise Architect Exam Guide
this week in the
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
Getting current mouse position
Basic Concepts of AWT Event Generation
Current mouse location...
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014