Help Center

Local Navigation

Create an option button

Use option buttons to indicate a set of mutually exclusive but related choices.
  1. Import the following classes:
    • net.rim.device.api.ui.component.RadioButtonGroup
    • net.rim.device.api.ui.component.RadioButtonField
  2. Create an instance of a RadioButtonGroup.
    RadioButtonGroup rbGroup = new RadioButtonGroup();
    
  3. Create an instance of a RadioButtonField for each option you want to make available to the BlackBerry® device user.
    RadioButtonField rbField = new RadioButtonField("First option");
    RadioButtonField rbField2 = new RadioButtonField("Second option");
    
  4. Invoke RadioButtonGroup.add() to add the RadioButtonField instances to the RadioButtonGroup.
    rbGroup.add(rbField);
    rbGroup.add(rbField2);
    

Index


Was this information helpful? Send us your comments.