File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Swing / AWT / SWT and the fly likes JMenu Menu hiding behind JPanel Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JMenu Menu hiding behind JPanel" Watch "JMenu Menu hiding behind JPanel" New topic

JMenu Menu hiding behind JPanel

Ron Patel

Joined: Apr 11, 2004
Posts: 18
Hey everyone,

I have a very strange problem that I never saw before. I have a JFrame with a JMenu. As the content pane, I have a JPanel that contains a GUI generated by code written using JNI.

When I click on the JMenu, the drop down menu hides behind the JPanel so nobody can see the menu.

However, if I use just a blank JPanel, I can see the drop down menu.

How can you fix this?
jefff willis
Ranch Hand

Joined: Sep 29, 2004
Posts: 113
Sounds like you need to make it a heavyweight object.

Put something like this in your panel code:

setLightWeightPopupEnabled( false );
I agree. Here's the link:
subject: JMenu Menu hiding behind JPanel
It's not a secret anymore!