GridBag Constraints:
The given GridBagConstraints public data members determine how your controls are placed:
1. An anchor member specifies how a control is shown if it is smaller than the grid cell in that it is placed. This member coyld be set to CENTER, NORTH, SOUTH, EAST, WEST, SOUTHEAST, NORTHEAST, OUTHWEST or NORTHWEST.
2. An fill member lets a control grow to fill its allotted grid cells if the cells are huger than the control's default size. The selection for this member is BOTH, VERTICAL, HORIZONTAL, and NONE.
3. A gridheight and gridweight members determine how much grid cells a control takes up.
4. A gridx and gridy members specify the row and column (in grid coordinates) at that to place the control.
5. The ipadx and ipady members identify the vertical and horizontal gap (or padding) for components.
6. The weightx and weighty members specify how excess space is assigned to the several components if the container in that they are embedded is resized.
7. The Insets member is a class which specifies the margins of a Container which has a GridBagLayout.
Through using the GridBagLayout and GridBagConstraints classes, you could generate layouts to meet nearly all your requirement. There is always the option of creating your own LayoutManager if these are not flexible enough for you. You create your own LayoutManager through creating a class (subclassed from Object) which implements the LayoutManager interface.