You can use the visual editor to bind the action of a Swing JButton
to perform a service made available by a data source.
A Swing JButton is typically used to perform some action. The Java
visual editor provides a binder class (SwingDataServiceAction) that you can
use to program a button to perform a specific service on a data source. To
configure the action binder for a button, you simply name the data source
and the source service, as well as any parameter required by the service.
In addition, the action binder can also set the component's initial state
and it can change the state based on several different conditions. For example,
if the argument object for the action changes, you can specify that the button's
state is enabled. For example, a button might be used to update an employee's
name after it has been changed in a text field. The action binder for the
button could enable the button when it detects that the last name is changed.
The
following screen shot shows a button that is bound to a service provided by
a Web service data source. The visual editor draws a dotted line from the
action binder's argument object to the binder line. The icon on the line represents
the SwingDataServiceAction binder for the button.

To configure an action
binder for a button: