In order to bind Java visual components, you need to first create
a data object that can provide appropriate data for the visual component.
Because
different types of visual components require different types of data, the
Java visual editor provides different types of data objects. For example,
a JTable requires an array of objects, so you need a row data object. A JTextField
on the other hand typically only needs a single property in a data object,
so you need a basic data object. Data objects can get their data directly
from a data source, or they can get data indirectly from other data objects
or factories.
There are two main ways that you can create a data object:
- Drop a data object from the palette onto the free-form area and configure
it using the Properties view.
- Click the New Data Source Data Object button on the Bindings dialog
while binding a visual component. Only data source data objects can be created
using the dialogs. Data source data objects are objects that wrap a Java object
that is created from a data source. To create a basic data object, you must
drop it from the palette.
To use the New Data Source Data Object dialog to create a new
data source data object:
The new data object is created, and the visual editor displays an
item on the free-form area to represent the new data object. The following
screen shot shows an example data object on the free-form area of the Java
visual editor:
