The java.awt.ItemSelectable Interface

Classes that implement the ItemSelectable interface have zero or more items that can be selected, or in the case of checkboxes, checked. We've listed the methods defined in the ItemSelectable interface in Table 13-1. As you can probably gather, classes that implement the ItemSelectable interface fire item events, thus, the item listener registration methods. The ItemListener interface defines one method: void itemStateChanged(ItemEvent). Whenever an item in an ItemSelectable changes state, an item event is fired to all currently registered item listeners.[2]

[2] See “Item Events”.

Table 13-1. java.awt.ItemSelectable Interface
Method Intent
Object[] getSelectedObjects() Returns an array of the currently selected ...

Get Graphic Java™ 1.2, Volume I: AWT, Third Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.