2 years ago

#15972

test-img

prismflux

Passing mouse control to JComponent which is not drawn inside JFrame

I‘m currently trying to render and use JComponents and it’s ancestors in a Custom Java Canvas. Right now, I‘m trying to create a Menu which should be clickable and it displays just fine inside my canvas when drawn with JComponent.draw(g). But the last piece I‘m trying to solve is that it should also react to the mouse-events the canvas generates (like hoovering over a JButton, clicking a JButton, etc etc). I only found listeners for events generated by the component…

So, is there any way I can tell a JComponent to not use its mouse events but instead pass through the events from somewhere else?

java

swing

canvas

awt

jcomponent

0 Answers

Your Answer

Accepted video resources