Basic HTML version of Foils prepared March 23 98

Foil 18 Hooking up Beans with events

From JavaBeans and Use in ComponentWare Basic Information Track Computational Science Course CPS616 -- March 25 1998. by Nancy McCracken, Geoffrey C. Fox, Wojtek Furmanski


Consider the standard example of hooking up two buttons to start and stop the Juggler animation bean.
First we place a button and name it start. We want to hook up its actionEvent with the method called start() in the Juggler, which starts the animation.
The BeanBox allows us to select the actionPerformed event from the "button push" menu, select the Juggler bean to be the target, and select its start method.
What this does is to create a class that implements an ActionListener (or inherits from the ActionListener adapter class).



© Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Sun Nov 29 1998