java.awt.GridBagConstraints (JDK 1.0)
This class encapsulates the instance variables that tell a GridBagLayout how to position a given Component within its Container.
gridx,gridy- These fields specify the grid position of the component. The
RELATIVEconstant specifies a position to the right or below the previous component. gridwidth,gridheight- These fields specify the height and width of the component in grid cells. The constant
REMAINDERspecifies that the component is the last one and should get all remaining cells. fill- This field specifies which dimensions of a component should grow when the space available for it is larger than its default size. Legal values are the constants
NONE,BOTH,HORIZONTAL, andVERTICAL. ipadx,ipady- These fields specify internal padding to add on each side of the component in each dimension. They increase the size of the component beyond its default minimum size.
insets- This
Insetsobject specifies margins to appear on all sides of the component. anchor- This field specifies how the component should be displayed within its grid cells when it is smaller than those cells. The
CENTERconstant and the compass-point constants are legal values. weightx,weighty- These fields specify how extra space in the container should be distributed among its components in the X and Y dimensions. Larger weights specify that a component should receive a proportionally larger amount of extra space. A zero weight specifies that the component should not receive any extra space. These weights specify the resizing behavior of the component and its container.
See also GridBagLayout.
public classGridBagConstraintsextends Object implements Cloneable, Serializable { //Public ConstructorpublicGridBagConstraints(); //Constantspublic static final intBOTH; public static final intCENTER; public static final intEAST; public static final intHORIZONTAL; public static final intNONE; public static final intNORTH; public static final intNORTHEAST; public static final intNORTHWEST; public static final intRELATIVE; public static final intREMAINDER; public static final intSOUTH; public static final intSOUTHEAST; public static final intSOUTHWEST; public static final intVERTICAL; public static final intWEST; //Public Instance Variablespublic intanchor; public intfill; public intgridheight; public intgridwidth; public intgridx; public intgridy; public Insetsinsets; public intipadx; public intipady; public doubleweightx; public doubleweighty; //Public Instance Methodspublic Objectclone(); //Overrides Object}
Passed To:
GridBagLayout.AdjustForGravity(), GridBagLayout.setConstraints()
Returned By:
GridBagLayout.getConstraints(), GridBagLayout.lookupConstraints()
Type Of:
GridBagLayout.defaultConstraints