![]() |
![]() |
![]() |
![]() |
GridBag Layout
The GridBag Layout is the most flexible and versatile layout among the AWT Layout Managers. Once a set of parts have been added, the user can specify a set of constraints to be applied to each part to indicate how the parts should be laid out with respect to each other.
A GridBag Layout starts out with a single Empty Space. The user can add or remove Empty Spaces, as well as change the order of parts using the buttons at the top of the properties page. The rest of the properties page is a table which shows the constraints for each part that is placed in the layout. Any of these constraints can be edited in this table.
- gridx, gridy The part's position in the grid.
- width, height The number of rows and columns the part should occupy.
- anchor A part can be anchored to any side of its cell. The user can choose a value by clicking the mouse in the grid in the appropriate table cell.
- fill How the part should expand to fill extra space. The possible values are none, horizontal, vertical, and both. The user can cycle through these values by clicking the mouse on the appropriate table cell.
- xweight, yweight Specifies how extra space should be distributed among parts.
- x internal..., y internal... Internal padding of the part.
- top inset, left inset, bottom inset, right inset External padding of the part.
Data Representations, Inc. http://www.datarepresentations.com support@datarepresentations.com sales@datarepresentations.com |
![]() |
![]() |
![]() |
![]() |