|
Tutorial Example
Introduction
PanelBuilder mainly offers two benefits over the basic FormLayout. One is the
ability to add a separator component, another is the linking a JLabel component
with another Swing component. However, since I have provided
1. Specify PanelBuilderTo use the PanelBuilder, first place
<panel> <panelbuilder> <formlayout columnspec="pref, 4dlu, 50dlu, 4dlu, min" rowspec="pref, 2dlu, pref, 2dlu, pref, 2dlu, pref" > <form-rowgroup rows="3, 5, 7"/> </formlayout> </panelbuilder> </panel> It is very important to have the 2. Add a SeparatorWith <panelbuilder>, it is not necessary to specify the <form-separator text="<panelbuilder> Tutorial"/> 3. Add and Link a Label with a Swing ComponentThe main attraction of using a Builder is to link a text label with a Swing component. <panelbuilder> can do it quite easily. <form-label text="Label &1" labelconstraints="1, 3" componentconstraints="3, 3, 3, 1" > <textfield/> </form-label> By comparison, adding/linking components without using <cellconstraints xy="1, 7"> <label text="Label 3" displayedmnemonic="VK_3" labelfor="id:field3"/> </cellconstraints> <cellconstraints xy="3, 7"> <textfield id="field3"/> </cellconstraints> |