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

Panel Element

Group membership: Controls

Declares a new panel in which other controls can be added.

This element also provides shortcuts when specifying one of the standard layout managers ( BorderLayout, FlowLayout or GridLayout).

Attributes

Name Type Required Description
alignment CDATA No

Will try to set the alignment property on the layout manager. If the layout manager does not have a proper method, a parsing exception will be thrown.

Literal values

Value Description
center

Centers controls in the container.

left

Aligns controls on the left side of the container.

right

Aligns controls on the right side of the container.

columns CDATA No

Will try to set the columns property on the layout manager. If the layout manager does not have a proper method, a parsing exception will be thrown.

hgap CDATA No

Will try to set the hgap property on the layout manager. If the layout manager does not have a proper method, a parsing exception will be thrown.

id ID No

Identifies the name by which this control will be referenced by other parts of the JGB XML file or Java code.

layout CDATA No

A fully qualified class name that declares which class to instantiate and add as a layout manager.

As a shortcut, it is possible to not prefix the full package information in the attribute's value. If the class cannot be found using the fully qualified class name, JGB will prefix java.awt. to the attribute value and try again.

reflabel IDREF No

Identifies a control that prompts this one.

rows CDATA No

Will try to set the rows property on the layout manager. If the layout manager does not have a proper method, a parsing exception will be thrown.

vgap CDATA No

Will try to set the vgap property on the layout manager. If the layout manager does not have a proper method, a parsing exception will be thrown.

Example usage

…
<!-- Use a java.awt.BorderLayout to layout this panel.  The fully qualified class name is
    not specified here, so JGB will try with "java.awt." prefixed.
-->
<panel layout="BorderLayout">
    <constraints>
        <constant name="java.awt.BorderLayout.CENTER"/>
    </constraints>
    …
</panel>

…

<!-- Here, we specify the fully qualified class name so, JGB will search only once. -->
<panel layout="javax.swing.SwingLayout">
    …
</panel>

…

<!-- Here, we are setting properties of the java.awt.GridLayout layout manager
    at the same time.
-->
<panel layout="GridLayout" columns="2" rows="4">
    …
</panel>
…
        

Parent element(s)

controls, control, panel, tab.

Child element(s)

border, button, check, combo, constraints, control, glue, label, list, methodCall, panel, property, radio, register, sheet, strut, table, textfield.
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 |