View Events and Listeners

Each Java-Client Dataview has a set of listener interfaces that make it easy to listen for special events on a view. The view events include information about the part of the view that is involved with the user action. For example, the ViewMouseEvent is a MouseEvent that identifies the component on which the mouse has moved or been clicked.

The following table lists the listener interfaces, the events that the view passes to the listeners, and the action that triggers the events.

Listener interface

Event

Action that triggers the events

ViewFocusListener

ViewFocusEvent

The focus is given to a component

ViewKeyListener

ViewKeyEvent

A key is pressed

ViewListener

DataviewEvent

A view is printed

ViewMouseListener

ViewMouseEvent

The mouse moves over a component or is clicked on a component

ViewMouseMotionListener

ViewMouseEvent

The mouse is used to drag a component