Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with swing components

 
Paul Bull
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Paul Bull
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Cindy
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic