• Post Reply Bookmark Topic Watch Topic
  • New Topic

GridBagLayout  RSS feed

 
Allion Salvador
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
:roll: :roll: Hello everyone! Does anyone know about the GridBagLayout manager? Thanx for any help!
 
Stephen Boston
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
Rob Spoor
Sheriff
Posts: 21052
85
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • 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.
 
Joe Ess
Bartender
Posts: 9426
12
Linux Mac OS X Windows
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Thank you! I got it! >
 
Stephen Boston
Ranch Hand
Posts: 165
  • Mark post as helpful
  • send pies
  • 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.
 
Jeff Albertson
Ranch Hand
Posts: 1780
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!