Palm API
Beta 2

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

Submit a bug or feature

The GUI classes provided with this release are NOT part of CLDC, and they will be removed in later releases of this software. Official GUI classes for Java 2 Micro Edition will be defined separately through the Java Community Process and included in J2ME profiles. Java is trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-2000 Sun Microsystems, Inc.
901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
All Rights Reserved.