This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

GridBag help

 
Mousa A. Rafi
Greenhorn
Posts: 28
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Finally I'm feeling comfortable with GridBagLayout and the constraints used by GridBagConstraints. However I'm still confused with weightx and weighty. I'm not sure how they work and what good using them. The only visible effect I got is, suppose when using weighty, extra space is entered between two components when the window is enlarged vertically. I'm also confused about the values (0.0 - 1.0) used for these.

Despite its flexibility, I'm unable to do the following using GridBagLayout: I have three buttons. two below the other. I want to make the top one as long as the total length of the bottom two. That is the top button spans two columns.
 
Craig Wood
Ranch Hand
Posts: 1535
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Using the weight constraints is more subtle and is a key to fluid layouts that resize gracefully. The nominal range is 1 to 1.0 but some prefer to use larger, integer values.
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic