Would you like to tell us how we are doing?

You bet No thanks

Sorry about the red box, but we really need you to update your browser. Read this excellent article if you're wondering why we are no longer supporting this browser version. Go to Browse Happy for browser suggestions and how to update.

Choice field: check box

Use check boxes for options that BlackBerry device users can select or clear. Users can select any number of check boxes in a group.

Class

CheckboxField

Supported since

BlackBerry Java SDK 3.7

More information

For more information about check boxes, see the UI Guidelines.

Example

This screen shows check boxes.

import net.rim.device.api.ui.Field;
import net.rim.device.api.ui.UiApplication;
import net.rim.device.api.ui.container.MainScreen;
import net.rim.device.api.ui.component.LabelField;
import net.rim.device.api.ui.component.CheckboxField;

public class CheckboxFieldDemo extends UiApplication
{
    public static void main(String[] args) 
    {
        CheckboxFieldDemo theApp = new CheckboxFieldDemo();
        theApp.enterEventDispatcher();
    }
    
    public CheckboxFieldDemo()
    {
        pushScreen(new CheckboxFieldDemoScreen());
    }
}

class CheckboxFieldDemoScreen extends MainScreen
{
    public CheckboxFieldDemoScreen()
    {
        LabelField title = new LabelField("Check Box Demo", 
            LabelField.ELLIPSIS | LabelField.USE_ALL_WIDTH);
        setTitle(title);
        
        CheckboxField checkBox1 = new CheckboxField("Ignore Case", true);
        CheckboxField checkBox2 = new CheckboxField("Ignore Acronyms", false);
        add(checkBox1);
        add(checkBox2);
    }
}