public boolean isOptionSelected(int index){
  if (index >= selectionPanel.getComponents().length) {
    return false;
  }
  JRadioButton radioButton=(JRadioButton)selectionPanel.getComponent(index);
  if (radioButton.isSelected()) {
    return true;
  }
 else {
    return false;
  }
}

public boolean isOptionSelected ( int index ) { if ( index >= selectionPanel . getComponents ( ) . length ) { return false ; } JRadioButton radioButton = ( JRadioButton ) selectionPanel . getComponent ( index ) ; if ( radioButton . isSelected ( ) ) { return true ; } else { return false ; } }
checks , if the specified radio button is selected .
