Summary

The AWT offers three components that implement the ItemSelectable interface: choices, checkboxes, and lists. Item selectables, of course, are components that contain zero or more selectable items. Item selectables are also capable of firing item events whenever an item is selected or deselected.

Choices and lists serve similar purposes; which one to employ in a given situation depends upon the needs of the moment. We have provided some guidelines for deciding whether to use a choice or list depending upon the requirements of the user interface in which they reside.

We've also provided some examples of common user interface components, such as a double list and a font panel for selecting a font.

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.