| The Essential JViews Framework > Getting Started with JViews Framework > Step 3 - Using Events > Listening for a Change of Interactors |
Listening for a Change of Interactors |
INDEX
PREVIOUS
NEXT
|
In the Sample3.java file, you will notice that the class implements the interface InteractorListener. You may also have noticed that we have imported a new package, ilog.views.event, which is the package that contains the ILOG JViews event classes. The InteractorListener interface includes one method:
void interactorChanged(InteractorChangedEvent event)
In this example, we want the selected button to be red when its corresponding interactor is attached to the view.
The interactorChanged method will be called when the interactor changes on the view (as soon as the object, the instance of Sample3, is registered as a listener; see Registering the Listener). The parameter is an event that contains the old and the new interactor. We simply change the background color of the button corresponding to the newly installed interactor to red:
| Copyright © 1987-2007 ILOG S.A. All rights reserved. Documentation homepage. Legal terms. | PREVIOUS NEXT |