Win a copy of High Performance Python for Data Analytics this week in the Python forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

GridBagLayout

 
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
:roll: :roll: Hello everyone! Does anyone know about the GridBagLayout manager? Thanx for any help!
 
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Have you tried looking here?

Or here?

Take a look at those links and come on back if you have some specific questions.

[ November 15, 2005: Message edited by: Stephen Boston ]
 
Allion Salvador
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanx! I only had one question... (Please bear with me, I'm only 11 years old) I don't get the ipady() method in the API docs. What's the internal padding? If you could answer me, I'd REALLY appreciate it. Thanks!
 
Sheriff
Posts: 22058
113
Eclipse IDE Spring VI Editor Chrome Java Ubuntu Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
From the API:

Specifies the component's internal padding within the layout, how much to add to the minimum size of the component. The width of the component will be at least its minimum width plus (ipadx * 2) pixels (since the padding applies to both sides of the component). Similarly, the height of the component will be at least the minimum height plus (ipady * 2) pixels.

 
Bartender
Posts: 9623
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The height of a grid cell in a GridBagLayout is determined by the minimum height of the component in that cell (i.e. a button, label, etc.) and the value for ipady. Since the default falue for ipady is 0, the default height for a grid cell is the same as the height of the component. We use ipady to make the grid cell taller than the component, "padding" the space between this component and the component above and below it.
ipadx does the same thing for grid components that are next to each other.
[ November 17, 2005: Message edited by: Joe Ess ]
 
Allion Salvador
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you! I got it! >
 
Stephen Boston
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Allion Salvador:
Thanx! I only had one question... (Please bear with me, I'm only 11 years old) I don't get the ipady() method in the API docs. What's the internal padding? If you could answer me, I'd REALLY appreciate it. Thanks!



Well Allion, it looks like you got your answer.
As far as just being 11, don't worry anout it. Heck I'm 45 and Gridbaglayout took me a while to grasp too.

Never be afraid to asks questions, especially here at JavaRanch! IMHO, best java forum on earth.
 
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Also, as a fan of graemlins, you may want to use this unlisted javaranch one:
That is http://www.javaranch.com/ubb/yelrotflmao.gif
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic