Binding Two Bean Properties
See Also
Once you have created a new Java form and added components to the form,
you can generate code to bind properties of components to keep
the values of those properties synchronized.
Before binding component properties, you need to have done the following:
- Bindings can be two-way (read/write), so that changes in the target
are automatically reflected in the source. However, the direction of the
initial binding is always from the source to the target. You can set
the update behavior of bindings on the Advanced tab of the Bind dialog box.
To bind two properties:
- In the GUI Builder, right-click the component that will be the target
of the binding, select Bind, and choose the property that you want to
bind from the Bind submenu.
- From the Binding Source combo box, select the component that contains
the property to which you want to bind.
- From the Binding Expression combo box, select the property to which
you want to bind.
- Optionally, select the Advanced tab
to further configure the binding. For example,
you can change the update strategy, specify a validator or converter, and specify behavior
if the binding source is null or unreadable.
- Click OK.
- See Also
- Binding Data to a Swing Component
- Adding a Component to a Form
- Editing Component Properties
- Converting Values Between Source and Target Properties
- Validating Target Value Changes in Bindings (Java Desktop Applications)
- Designing Java GUIs with the GUI Builder
- Adding a Bean to the Palette Window
Legal Notices