com.sun.kjava
Class RadioGroup

java.lang.Object
  |
  +--com.sun.kjava.RadioGroup

public class RadioGroup
extends java.lang.Object

An object representing a group of RadioButtons. At most one RadioButton in a RadioGroup can be selected at one time.

See Also:
RadioButton

Constructor Summary
RadioGroup(int numButtons)
          Create a new RadioGroup.
 
Method Summary
 void add(RadioButton theButton)
          Add a RadioButton to the RadioGroup.
 RadioButton buttonAt(int i)
          Get the RadioButton at an index.
 RadioButton getSelected()
          Get the currently selected RadioButton.
 boolean hasSelection()
          Is any one of the RadioButtons in the group selected?
 void setSelected(RadioButton theButton)
          Set the currently-selected RadioButton.
 int size()
          How many RadioButtons in this group?
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RadioGroup

public RadioGroup(int numButtons)
Create a new RadioGroup.
Parameters:
numButtons - the number of RadioButtons it will contain
Method Detail

add

public void add(RadioButton theButton)
Add a RadioButton to the RadioGroup.
Parameters:
theButton - the RadioButton to add

buttonAt

public RadioButton buttonAt(int i)
Get the RadioButton at an index.
Parameters:
i - the index of the RadioButton to return
Returns:
the requested RadioButton

setSelected

public void setSelected(RadioButton theButton)
Set the currently-selected RadioButton. Clear the old selection.
Parameters:
theButton - the RadioButton to select

getSelected

public RadioButton getSelected()
Get the currently selected RadioButton.
Returns:
the currently selected RadioButton

hasSelection

public boolean hasSelection()
Is any one of the RadioButtons in the group selected?
Returns:
true if one of the RadioButtons in the group is selected.

size

public int size()
How many RadioButtons in this group?
Returns:
the number of RadioButtons in the group