• Post Reply Bookmark Topic Watch Topic
  • New Topic

JMenuItem behind other components

 
Chip Gobs
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

My JMenuItems off of my main menu bar sometimes appear BEHIND components in the Frame's contentPane. I've only noticed this happening with a subclass of java.awt.Canvas in which I am displaying an image.
Does anyone have an idea about what property I need to set to keep this from happening?
Thanks,
Chip
 
Gregg Bolinger
Ranch Hand
Posts: 15304
6
Chrome IntelliJ IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I had that same problem and am not sure how to fix it, since I just scrapped the idea of using a canvas. The reason this happens though is because you are mixing lightweight and heavyweight components.
You might try setting the canvas to MIN_VAL so that it lays on the very bottom layer of all your components.

------------------
Happy Coding,
Gregg Bolinger
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!