Help Center

Local Navigation

Create a drop-down list

Use drop-down lists to provide a set of mutually exclusive values.

  1. Import the following classes:
    • java.lang.String
    • net.rim.device.api.ui.component.ObjectChoiceField
    • net.rim.device.api.ui.container.MainScreen
  2. Create an instance of an ObjectChoiceField, providing an object array as a parameter to create a drop-down list that contains objects.
    String choiceItems[] = {"Option one","Option two","Option three"}; 
    mainScreen.add(new ObjectChoiceField("Select an option: ", choiceItems));

Index


Was this information helpful? Send us your comments.