• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

GridBagLayout problem

 
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I used a JFrame includeing a Container, thus ,I set Container with GridBagLayout,but it seems that I even can't put the JToolBar at the top of the Container. it always at the center of the Container. I already use the GridBagConstraints, but it didn't affect too much. I got confused about the GridBagConstraints.
how should i set the gridx,gridy,gridweitht,gridheight,weightx,weithty,fill,anchor to make sure the toolbar is at the top of the Container, my ComboBox Panel is under that, my JTable Panel is under the ComboBox Panel!
thanks!
 
Ranch Hand
Posts: 883
3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you want to have an outer panel for the JToolbar and use a BorderLayout so it can dock to any of the sides.
Then add your panel with the GridBagLayout in to the outer panel using BorderLayout.CENTER and you should be Ok.
 
reply
    Bookmark Topic Watch Topic
  • New Topic