|
8.8. Laying out Components
Layout plays an important role in designing User Interface for Applications. The layout support in AdventNet Bean Builder provides you the faster and efficient development of UI.
Each container either has a layout manager or uses absolute positioning. All JPanel objects are initialized to use a Flow Layout. Content panes (the main containers in JApplet, JDialog, and JFrame objects) use Border Layout, by default.
The following Layouts are supported by the draw area provided with AdventNet Bean Builder.
Viewing the Current Layout
Select the Screen/Component for which you would like to view the Layout.
Right click on the Screen/Component. This brings up a Popup menu.
From the Popup menu, select the menu item Layout. This brings up a sub popup menu listing all the possible layouts. Each Layout menu item has a RadioButton associated with it, with one selected at any point of time.
The selected RadioButton indicates that the Layout corresponding to the selection is the current layout for the Screen/Component.
Setting/Changing the Layout
Select the Screen/Component for which you would like to Set/Change the layout.
Right click on the Screen/Component. This brings up a Popup menu.
From the Popup menu, select the menu item Layout. This brings up a sub popup menu listing all the possible layouts. Each Layout menu item has a RadioButton associated with it, with one selected at any point of time.
Select the RadioButton corresponding to the Layout you would like to set on the Screen/Component.
Setting Layout Properties
Select the Screen/Component to set the layout properties of the components inside the Screen/Component.
Right click on the Screen/Component. This brings up a Popup menu.
Select the Layout Properties menu item.
This invokes the Dialog which is based on the current Layout set for the Screen/Component.
Resizing in Layout
Resizing is not allowed for all the layouts, i.e, only in some specific layouts, components are allowed to resize. The following are the layouts in which the resizing is allowed:
Null Layout (or) Position Layout.
Border Layout.
Flow Layout.
|