Title: GridBagConstraints
Course: CPS 161: An Intro to Programming with Java - DL MM MASTER

GridBagConstraints

Name | Applies to | Default | Valid Values | Description
anchor | Component | CENTER | CENTER, EAST, NORTH, SOUTH, NORTHWEST, NORTHEAST, SOUTHWEST, SOUTHEAST | Where to anchor a component within its grid cells
fill | Component | NONE | BOTH, HORIZONTAL, VERTICAL, NONE | The manner in which the component fills the grid cells it occupies
gridx, gridy | Component | RELATIVE | RELATIVE, or integer values representing an x,y position in the grid | The Position of the component's upper left-hand grid cell
gridwidth, gridheight | Display area | 1,1 | REMAINDER, RELATIVE, or integer values representing the width and height in grid cells | The number of grid cells in both horizontal and vertical directions allotted for the component. Whether or not a component fills its grid cells depends upon the fill attribute
ipadx, ipady | Component & Display area | 0,0 | Integer values representing number of pixels | Internal padding that increases the component's preferred size. Negative values are allowed, which reduces the component's preferred size
insets | Component & Display area | (0,0,0,0) | An Insets object | External padding between the edges of the component and edges of its grid cells. Negative values are allowed, which cause the component to extend outside of its grid cells
weightx, weighty | Display area | 0.0, 0.0 | representing weighting given to a component's grid cells relatvie to other components in the same row or column | How extra space is consumed by the component's grid cells. Whether or not a component fills its grid cell depends up the fill attribute. Values must be positive

Last Updated: December 13, 2002 9:36 AM