aspose file tools*
The moose likes Beginning Java and the fly likes Problems with swing components Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problems with swing components" Watch "Problems with swing components" New topic
Author

Problems with swing components

Paul Bull
Ranch Hand

Joined: Feb 14, 2001
Posts: 37
Hello Everyone,
I have a problem I'm hoping someone can help me solve.
I am working on a gui interface. It consists of a JFrame. I added
a JMenuBar to the top of the JFrame using the setJMenuBar() method. Next I added a vertical Box set at BorderLayout.NORTH. In the vertical Box I added two horizontal Boxes. The top Box contains two Choice fields. The bottom contains a textfield. My problem is, when I click "file" on the MenuBar, the pull down menu with my menu items is partially hidden behind a Choice field and textfield below it. Is there anything I can do with these components so my pull down menu is not obscured by these components below it?
Any advice would be greatly appreciated.
Thanks,
Paul
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
The problem is that you are mixing AWT heavyweight things (Boxes) with Swing lightweight things (JFrames and JMenuBars). The heavyweight things will always hide the lightweight things.
You need to decide Swing or AWT and then stick with that.


"JavaRanch, where the deer and the Certified play" - David O'Meara
Paul Bull
Ranch Hand

Joined: Feb 14, 2001
Posts: 37
Thanks Cindy
 
 
subject: Problems with swing components