• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

GridBagLayout Question

 
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm using GridBayLayout, and I want to have some blank space at the top of my panel, and an even amount of blank space at the the bottom, with the components in the middle.
Now, I can evenly space the components using weighty=1, or I can bunch them up in the middle using weighty=0, but it's not what I want.
Do I have to make a bogus component or could I just start gridy at a different starting location? (Seems like this might work for the top space, but not the bottom space?)
Thanks,
Drew
 
Ranch Hand
Posts: 196
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Drew,
it is easier, you have to use the margins of the components to win free space. So maybe to all of your top components, you set the marigin (5,30,0,0), which means to the left component or to the border, there are 5 pixels space and to the top border 30 pixels.
And to your bottom components, you can set something like (5,5,0,30).
Hope that's clear
Rene
 
Drew Lane
Ranch Hand
Posts: 296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yeah, you are right.
I just had to set the Insets.
Thanks,
Drew
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic