Make Component Ignore Mouse Events


#1

I have a component which is set to receive global mouse events. This causes a duplicate event whenever the component itself is clicked (one for the global event, one for the built-in MouseListener inheritance.) Calling removeMouseListener(this); in the constructor does not solve the problem. Is there any way I can disable this?


#2

You should just create a different MouseListener object to receive the global events rather than trying to force a single component to handle all the events from these different sources.


#3

You can disable any mouse events on a component using Component::setInterceptsMouseClicks(false, true).
Is this what you are looking for?