RadioButtonListBox Demo and Documentation

A RadioButtonListBox is a list box with radio buttons created from array of strings.

The two RadioButtonListBoxes are the same except the constructor for the left list box suppled the "usePanel" parameter as true to ask for a box around the buttons while the second used false to avoid the rectangle about the buttons.

Fields x, y, and w are for location of the top left corner, and width of the box. h is the height of the optional panel and specifies its height if it is greater than zero. h = 0 means there is no panel.

Display sketch code: RadioButtonListBoxDemo.pde. The code for RadioButtonListBox is in Clickable.pde


class RadioButtonListBox
extends ListBox
which extends Clickable

The constructor is nearly the same as the first constructor of ListBox but produces circular buttons.

** RadioButtonListBox(int leftX, int topY, int theWidth, String label, String[] labels,
                                        boolean usePanel, color buttonPanelColor)
- A RadioButtonListBox is identical to a ListBox except that it automatically creates RadioButtons from the labels array instead of standard rectangular buttons. It will automatically put a panel under the buttons if usePanel is true. If you want a RadioButtonListBox with special buttons, create a ListBox using the second or third constructor.

Inherited from ListBox

Fields
ITEM_HEIGHT, buttonListArray, buttonListGrp, showSelected,, c, overC, clickedItemNum, panelColor

Constructors
ListBox, ListBox, ListBox, ListBox

Methods
checkForClick, display, isOver, getClickedItemNum, getGroupLength, getItem, getSelectedItem, getSelectedItemNum, getSelectedLabel, hasBeenClicked, setEnabled, setScrollable, setSelectedItemNum, setVisible, toString


Inherited from Clickable

Fields
NOTHING_CLICKED, COMBO_BUTTON, DISABLED_COLOR, borderColor, c, clicked, clickedItemNum, colorState, enabled, h, label, over, overC, scrollable, selected, selectedItemNum, visible, w, x, y

Constructors
Clickable

Methods
checkForClick, display, doNotSelect, getClickedItemNum, getColorState, getH, getItem, getLabel, getSelected, getSelectedItem, getSelectedItemLabel, getSelectedItemNum, getW, getX, getY, hasBeenClicked, hideSomething, isOver, setBorderColor, setColorState, setH, setLabel, setScrollable, setSelected, setSelectedItemNum, setEnabled, setVisible, setW, setX, setY, sX, sY

Return to the top of the page

Revised: 04/11/2014