- Field: A rectangular area that can be drawn on the screen of a device.
- Manager: An area that contains other UI components and handles layout and scrolling behavior.
- Screen: A drawable area that is pushed on to and popped off of an application's display stack.
- ButtonField: A simple button.
- DateField: A field that contains date and time values.
- LabelField: A text label.
- TextField: An editable text field.
The net.rim.device.api.ui.container package contains classes that you can use to arrange UI components on a screen, such as:
- FlowFieldManager: A manager that arranges fields horizontally and then vertically.
- HorizontalFieldManager: A manager that arranges fields in a single horizontal row.
- VerticalFieldManager: A manager that arranges fields in a single vertical column.
ButtonField mySubmitButton = new ButtonField("Submit");
CheckBox -
CheckboxField chk=new CheckboxField("First Check Box", true);
CheckboxField chk=new CheckboxField("First Check Box", false);
DialogBox -
Dialog.alert("Specify the alert text that you want to display.")
LabelField -LabelField title = new LabelField("UI Component Sample", LabelField.ELLIPSIS);
RadioButton -RadioButtonGroup rbg = new RadioButtonGroup();
add(new RadioButtonField("Option 1",rbg,true));
add(new RadioButtonField("Option 2",rbg,false));
DateTimePicker -
DateTimePicker datePicker = DateTimePicker.getInstance(); datePicker.doModal(); Calendar cal = datePicker.getDateTime(); Date date = cal.getTime(); Dialog.alert("You selected " + date.toString());
FilePicker -
FilePicker fp = FilePicker.getInstance(); FilePickListener fileListener = new FilePickListener(); fp.setListener(fileListener); fp.show();
class FilePickListener implements FilePicker.Listener { public void selectionDone(String str) { Dialog.alert("You selected " + str); } }
Text Fields -
RichTextField rich = new RichTextField("RichTextField");
BasicEditField bf = new BasicEditField( "BasicEditField: ", "", 10, EditField.FILTER_UPPERCASE);
EditField edit = new EditField( "EditField: ", "", 10, EditField.FILTER_DEFAULT);
AutoTextEditField autoT = new AutoTextEditField( "AutoTextEditField: ", "");
PasswordEditField pwd = new PasswordEditField("PasswordEditField: ", "");
No comments:
Post a Comment