Ignoring mouse clicks if area of JComponent is transparent

Hi folks. Any ideas/tutorials to help with ignoring transparent/non-painted regions of a JComponent which has a mouse listener attached to it?

In addition to this, how can you get a mouse click on a component to be passed to any components behind it on a LayeredPane if the click is inside this transparent area of the highest JComponent?

[351 byte] By [fireman.sparkeya] at [2007-11-27 5:03:28]
# 1

you'd need to know the Shape of the area that is not transparent, then you can test the coordinates. I'm not sure how you do that specifically, because it really depends on the component.

If in the transparent area, you can walk through components in the component, or up in the parent. But that also depends partly on how you structure things. Such as are the only subcomponents visible actually in the clicked component?

If you look at the source for JInternalFrame (or maybe it was BasicInternalFrameUI) there's a glasspane mouse event redirection code you can "borrow".

bsampieria at 2007-7-12 10:21:33 > top of Java-index,Desktop,Core GUI APIs...