13.16. Check Box Groups (Radio Buttons)
If you combine check boxes into a CheckboxGroup, you get versions with a different graphical look where only one can be selected at any one time. Selecting a new entry results in the previously selected entry becoming unselected. Just as with radio button input forms in HTML (see Chapter 18, “HTML Forms”), there is no requirement that all the check boxes in a given group be placed near each other. However, you typically want the check boxes grouped together, so place them in a Panel or choose an appropriate layout manager for the container. The most common usage is to first create the CheckboxGroup object, then to create the check boxes that belong to the group. In the check box constructor, you can also ...
Get Core Web Programming, Second 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.