Bind Dialog Box: Binding Tab (Java Desktop Applications)
See Also
This dialog box enables you to bind properties of JavaBeans components (beans)
with each other so that the values of those properties are synchronized. For example,
you could bind the value property of a JSlider component to the
a text property of a JTextField component.
The property for which you open the Bind dialog box serves as the target of the
binding. In the Bind dialog box, you specify the binding source and configure
the binding.
The dialog box opens when you do one of the following things:
- Right-click a component in the GUI Builder and choose a property from
the Bind submenu.
- Click the ellipsis (...) button for a property in the Binding category
of the property sheet of a bean.
The Binding tab of the dialog box contains a combination of the following fields:
- Binding Source. A drop-down list that contains a list of
visual components and other beans that are available for binding to the property
that was selected when you opened the dialog box.
For a bean to be available in this list, it needs to be
added to the form. See
Adding a Component to a Form.
- Binding Expression. A combo box where you can select or type a
property of the binding source to bind to the target property. This list might
also contain other types of expressions which you can use in the binding. Some of
the properties offered in this combo box are
special synthetic properties that are
added by the beans binding library to enable useful bindings that would not
be possible with the base set of properties for some components.
The expressions in this dialog box use Expression Language syntax.
Some bindings do not require a binding expression.
- Display Expression (only for elements property of
JList components). Similar to the Binding Expression field, this property enables you to
determine what is displayed for the user in the JList.
This field corresponds to the JListBinding.DetailBinding
class.
- Import Data to Form (only for elements property of
JTable, JList, and JComboBox components). Enables you to select columns from a database
table to bind to the form. If there is no entity class in your project that represents the
database table to which you are binding, the IDE will create such an entity class.
- If the table to which you are binding has any foreign keys, those keys will not be
taken into account in the generation of the entity classes. In such a
case, it is better to use the
New Entity Class Wizard
to create the entity classes before importing the data to the
form.
- Available and Selected columns (only for elements property of
JTable components). After you have used the
Import Data to Form button to select a database table, you can use the
Available and Selected lists to move items into and out
of the JTable. The Selected list shows everything that will be displayed
in the table.
You can add items to a list and remove items from a list by
selecting an item and clicking the < and > buttons, or you
can click << or >> buttons to remove or add all items.
You can rearrange the items in the Selected list by selecting
an item and clicking the Up or Down button. The order in which items
appear in the Selected list is the order in which the columns appear
in your table.
- See Also
- Bind Dialog Box: Advanced Tab
- Designing Java GUIs with the GUI Builder
- Working with the GUI Builder
- GUI Builder Tasks: Quick Reference
Legal Notices