This week's book giveaway is in the Other Open Source APIs forum. We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line! See this thread for details.
You are adding three components so you will get three apparent columns showing. If you are going to add components in all five columns somewhere in rows that follow, ie, if there will be at least one component in each of the "5" columns somewhere in the layout, then GridBagLayout will size the columns to show the components at their preferred size plus any additional space as allocated by the judicious use of the weight constraints. If you must fill out the first row with 5 columns you can add blank labels with or without setting their preferred size. You might try adding all the components to the layout and then make adjustemnts as you feel your way toward success. If you want all the cells to be equal width you might consider using GridLayout for some (each row) or all of the layout.
Joined: Sep 05, 2005
Yes, but with GridLayout I can't strech coponent across 2 or more cells can I?