aspose file tools*
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


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JMenu Menu hiding behind JPanel" Watch "JMenu Menu hiding behind JPanel" New topic
Author

JMenu Menu hiding behind JPanel

Ron Patel
Greenhorn

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: http://aspose.com/file-tools
 
subject: JMenu Menu hiding behind JPanel