Numeric drop-down list

Use a numeric drop-down list for numeric options that BlackBerry® device users can select from a list. Users can select only one option at a time.

Class NumericChoiceField
Supported since BlackBerry® Java® SDK 3.6
Example This screen shows a numeric drop-down list.

For more information about numeric drop-down lists, see the UI Guidelines.

Code sample: Creating a numeric drop-down list

import net.rim.device.api.ui.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;

public class NumericDropdownListDemo extends UiApplication 
    public static void main(String[] args) 
        NumericDropdownListDemo theApp = new NumericDropdownListDemo(); 

    public NumericDropdownListDemo() 
        pushScreen(new NumericDropdownListDemoScreen()); 
class NumericDropdownListDemoScreen extends MainScreen 
    public NumericDropdownListDemoScreen() 
        setTitle("Drop-down List Demo"); 
        int iStartAt   = 1;
        int iEndAt     = 31;
        int iIncrement = 1;
        int iSetTo     = 10;
        add(new NumericChoiceField("Day of the month",iStartAt,iEndAt,iIncrement,iSetTo-1));
Next topic: Date field
Previous topic: Text-based drop-down list

Was this information helpful? Send us your comments.