com.sun.kjava
クラス RadioGroup

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

public class RadioGroup
extends java.lang.Object

RadioButton のグループを表すオブジェクトです。一度に選択できるのは、RadioGroup 内の 1 つの RadioButton だけです。

関連項目:
RadioButton

コンストラクタの概要
RadioGroup(int numButtons)
          新しい RadioGroup を作成します。
 
メソッドの概要
 void add(RadioButton theButton)
          RadioGroup に RadioButton を追加します。
 RadioButton buttonAt(int i)
          指定されたインデックスの RadioButton を取得します。
 RadioButton getSelected()
          現在選択されている RadioButton を取得します。
 boolean hasSelection()
          グループ内の RadioButton のどれかが選択されているかどうかを判定します。
 void setSelected(RadioButton theButton)
          現在選択されている RadioButton を設定します。
 int size()
          このグループ内にある RadioButton の数を返します。
 
クラス java.lang.Object から継承したメソッド
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

コンストラクタの詳細

RadioGroup

public RadioGroup(int numButtons)
新しい RadioGroup を作成します。
パラメータ:
numButtons - 包含する RadioButton の数
メソッドの詳細

add

public void add(RadioButton theButton)
RadioGroup に RadioButton を追加します。
パラメータ:
theButton - 追加する RadioButton

buttonAt

public RadioButton buttonAt(int i)
指定されたインデックスの RadioButton を取得します。
パラメータ:
i - 返される RadioButton のインデックス
戻り値:
要求された RadioButton

setSelected

public void setSelected(RadioButton theButton)
現在選択されている RadioButton を設定します。前の選択は解除します。
パラメータ:
theButton - 選択する RadioButton

getSelected

public RadioButton getSelected()
現在選択されている RadioButton を取得します。
戻り値:
現在選択されている RadioButton

hasSelection

public boolean hasSelection()
グループ内の RadioButton のどれかが選択されているかどうかを判定します。
戻り値:
グループ内の RadioButton のどれかが選択されている場合は true

size

public int size()
このグループ内にある RadioButton の数を返します。
戻り値:
グループ内の RadioButton の数