File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Swing / AWT / SWT / JFace and the fly likes JMenuItem behind other components Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Swing / AWT / SWT / JFace
Reply Bookmark "JMenuItem behind other components" Watch "JMenuItem behind other components" New topic
Author

JMenuItem behind other components

Chip Gobs
Greenhorn

Joined: Feb 15, 2001
Posts: 13

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
Sheriff

Joined: Jul 11, 2001
Posts: 15040

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


My Blog | DZone Articles
 
 
subject: JMenuItem behind other components
 
Threads others viewed
Problem with t:inputFileUpload
String replace method
customized jcomponent icon is painting itslef on top of menu
jsp action
Facing problem while tomcat 5.5 serves css, and jsp