Viewing the source for an event
When you select an event in the Java Beans view, the Source view shows the relevant lines in the Java code.
The visual editor for Java is a source-centric editor, so the views reflect the recognized code structures in the source. Synchronization of selection is a key feature of the editor, and when an item is selected in the Java Beans tree, the Source view shows the relevant lines in the Java code.
To show the source for an event, select the event in the Java Beans view.
- When an event is selected, the source code statements for the callback method on the listener are shown.
- When a listener is selected in Expert Events mode, the source code statement that adds the listener to the source is shown.
- If the listener is shared (so the callback method can be used by more than one component), selection will point to the relevant block of code responsible for processing the component that the event is a child of. The following image shows that the single inner class IvjEventHandler is used by both the class itself (this) and by a Cancel button. The keyPressed method has if blocks within the keyPressed(java.awt.event.KeyEvent) callback method to separate the logic processed when each button is pressed.
Parent topic
Handling events with the visual editor
Related concepts
The Java Beans view
Related tasks
Adding events to a component
Deleting events from a component
Viewing events for a component