Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Mouse events are going "through" my JPanel in a JLayeredPane

804030Dec 5 2010 — edited Dec 6 2010
Hello,

I use the JLayeredPane of a JFrame to show a JPanel "on top" of the normal View of my window. In that "popup" Panel I have some buttons - this works fine, but with one drawback:

When I don't click on a button on my "popup panel" but on the panel itself, the mouse click events are going through that panel to the normal JPanel of my JFrame, maybe pressing buttons behind it. So, my Popup-JPanel, which is on top of my normal JPanel/JFrame, does not catch/consume mouse events.

Do you have any idea how to stop mouse events to go through my popup-panel to the window/panel behind it?


Thanks a lot for your help!
This post has been answered by walterln on Dec 5 2010
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 3 2011
Added on Dec 5 2010
4 comments
1,171 views