Transparent window allow click through

I’ve got a window that is transparent that will overlay a main window at times. I need to have that transparent window to ignore any mouse events on that window. That way if this window covers objects below it they will respond properly to mouse events.

I’ve tried to remove the mouse listeners from the root container, but it appears that they don’t reside there.

window = event.source
window.setOpaque(0)

rootContainer = window.rootContainer
mls = rootContainer.getMouseListeners()
for m in mls:
	rootContainer.removeMouseListener(m)

If I check the length of mls it is 0.

So where do the mouse events reside? And how do I get there to remove them? Or am I going about this entirely the wrong way?

Java Swing doesn’t work this way. If a component doesn’t have a listener for an event, it will be passed to its parent. It doesn’t ever get passed to a sibling. The work-around would be to deliberately listen for them in your transparent window, and repackage and re-fire the event on the target window. This generally requires determining which inner component of the target window should receive the event, then recomputing the the event x and y accordingly. I recall @Kyle_Chase posting some examples of this sort of thing…

OK I was wondering if that was the case. The solution sounds a little more complicated then I want to take on at this moment.