Simple list
Use a simple list to display a list of items as text.
| Class | SimpleList |
| Supported since | BlackBerry® Java® SDK 6.0 |
| Example |
|
For more information about simple lists, see the UI Guidelines.
Code sample: Creating a simple list
import net.rim.device.api.ui.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.component.table.*;
public class SimpleListDemo extends UiApplication
{
public static void main(String[] args)
{
SimpleListDemo theApp = new SimpleListDemo();
theApp.enterEventDispatcher();
}
public SimpleListDemo()
{
pushScreen(new SimpleListScreen());
}
private static final class SimpleListScreen extends MainScreen
{
public SimpleListScreen()
{
super(Manager.NO_VERTICAL_SCROLL);
setTitle("Simple List Demo");
add(new LabelField("My list", LabelField.FIELD_HCENTER));
add(new SeparatorField());
Manager mainManager = getMainManager();
SimpleList listField = new SimpleList(mainManager);
listField.add("Item 1");
listField.add("Item 2");
listField.add("Item 3");
}
}
}
Next topic: Rich list
Previous topic: Lists and tables