Java Gui Builder
You are here: Home   >   Documentation   >   JGB Elements Documentation   >   Gridbag Element
JGB Element Navigation
tab
ref

Gridbag Element

Group membership: Layout control

gridbag refers to GridBagConstraints objects. The act of using gridbag instantiates (or reuses) a GridBagConstraints object that will be used subsequently as a constraint when adding controls.

For extra information on this element's attributes, please consult the Java API reference for the GridBagConstraints class.

Attributes

Name Type Required Description
anchor CDATA No

Defines the anchor position for controls added subsequently.

The value of this attribute must be the name of one of the constants defined in the GridBagConstrainst class.

See GridBagConstraints.anchor

fill CDATA No

Defines the resizing policy for controls added subsequently.

The value of this attribute must be the name of one of the constants defined in the GridBagConstrainst class.

See GridBagConstraints.fill

gridheight CDATA No

Defines the height of controls in the virtual grid.

See GridBagConstraints.gridheight

gridwidth CDATA No

Defines the width of controls in the virtual grid.

See GridBagConstraints.gridwidth

gridx CDATA No

Defines the X position in the virtual grid in which to add the control.

See GridBagConstraints.gridx

gridy CDATA No

Defines the Y position in the virtual grid in which to add the control.

See GridBagConstraints.gridy

insets CDATA No

Defines insets on subsequently added controls.

Insets use the same ordering as CSS2 for border elements. See margin property definition for more information.

See GridBagConstraints.insets

ipadx CDATA No

Defines padding in the X direction for subsequently added controls.

See GridBagConstraints.ipadx

ipady CDATA No

Defines padding in the Y direction for subsequently added controls.

See GridBagConstraints.ipady

weightx CDATA No

Defines the horizontal weight of this control when resizing the window.

See GridBagConstraints.weightx

weighty CDATA No

Defines the vertical weight of this control when resizing the window.

See GridBagConstraints.weighty

Example usage

…
<!-- Use a GridBagLayout class for this section of the window -->
<layout class="GridBagLayout"/>

<constraints>
    <!-- Set the constraints for the next control.
        We're going to add this new control at position 2 on the grid.
    -->
    <gridbag gridx="2"/>
</constraints>
<control …/>

<constraints>
    <!-- Give more weight to this other control.  -->
    <gridbag weighty="0.75"/>
</constraints>
<control …/>

<constraints>
    <!-- Give the remainder of the space on the line to this control.  -->
    <gridbag gridwidth="REMAINDER"/>
</constraints>
<control …/>
…
        

Parent element(s)

constraints.

Child element(s)

None
Back to top
SourceForge Logo
Hosted on SourceForge.net
Valid XHTML 1.0!
Valid XHTML 1.0 !
Valid CSS!
Valid CSS !
Code Coverage by Clover
Code Coverage provided by Clover
 |  Home |  License |  Downloads |  Documentation |  Developers |  Mailing Lists |  Dependencies |  Links |  Privacy Policy |  SF Project Home |