Basic HTML version of Foils prepared 13 July 98

Foil 97 Handling Choice Events

From Java Academy II:Intermediate Java NPAC/ECS Java Academy -- February to April 98. by Tom Scavo

The ChoiceTest Applet
Like checkboxes and radio buttons, Choice objects generate ItemEvents
These are handled in the usual way:
  • some class implements the ItemListener interface (and, hence, the itemStateChanged(...) method)
  • an instance of this class is added to the list of listeners using addItemListener(...)



© 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 Sat Nov 28 1998