tags:

views:

312

answers:

1

I have a JFrame with a menu bar and a canvas covering all the remaining surface. When I click on the menu bar, the menu opens behind the Canvas and I can't see it. Has anyone experienced this? Other than resizing the Canvas (which I am reluctant to do) is there any solution?

Thanks,
Vlad

+2  A: 

You're experiencing heavyweight vs. lightweight issues.

The quick fix:

// Call this sometime before you use your menus 
JPopupMenu.setDefaultLightWeightPopupEnabled(false)

Heavyweight vs. Lightweight

basszero
Or use a JComponent instead of a Canvas.
Tom Hawtin - tackline
The JComponent idea was actually saner. I didn't think of looking for a Swing equivalent of Canvas. Thanks :)
ddvlad