Setting Events With the Connection Wizard
See Also
You can use the Connection wizard to set events between two components within
a form without having to write code manually.
To set an event using the Connection wizard:
- Click the Connection Mode button (
)
in the GUI Builder toolbar.
- In the GUI Builder or Navigator window, select the component
that will fire the event.
- The selected component is highlighted in red when selected.
- Select the component whose state you want to affect with the event.
- The selected component is highlighted in red when selected.
- On the Connection wizard's Select Source Event page, select the event that
the trigger component will fire from the Events list by expanding the event type directory nodes.
Accept the default handler method name or type in a new name and click Next.
- On the Specify Target Operation page, specify the operation to be performed
on the target component by selecting the appropriate radio button and choosing
from the list of operations. Click Next.
- If you choose a method call with no parameters, the Finish button of the wizard becomes available.
- (Optional) If you wish to enter event handler code directly, choose the
User Code radio button and click Finish. The insertion point is placed in
the new event handler in the Source Editor, where you can write the event
handler code yourself.
- On the Enter Parameters page, specify the values for each tab's target property
or method by selecting the source from which each parameter's value is acquired.
The source code generated for each of the parameters is displayed in
the Generated Parameters Preview field.
- Click Finish.
The IDE automatically generates the code to connect the form's components.
- See Also
- Managing Component Events
- Designing Java GUIs with the GUI Builder
- About Java GUIs
Legal Notices