Create A Text Field; Create A Read-Only Text Field That Allows Formatting; Create An Editable Text Field That Has No Formatting And Accepts Filters; Create An Editable Text Field That Allows Special Characters - Blackberry JAVA DEVELOPMENT ENVIRONMENT - - DEVELOPMENT GUIDE Manual

Version: 4.7.0
Hide thumbs Also See for JAVA DEVELOPMENT ENVIRONMENT - - DEVELOPMENT GUIDE:
Table of Contents

Advertisement

Development Guide

Create a text field

Create a read-only text field that allows formatting

1.
Import the net.rim.device.api.ui.component.RichTextField class.
2.
Create an instance of a RichTextField.
RichTextField rich = new RichTextField("RichTextField");

Create an editable text field that has no formatting and accepts filters

1.
Import the following classes:
net.rim.device.api.ui.component.BasicEditField
net.rim.device.api.ui.component.EditField
2.
Create an instance of a BasicEditField.
BasicEditField bf = new BasicEditField("BasicEditField: ", "",
10, EditField.FILTER_UPPERCASE);

Create an editable text field that allows special characters

1.
Import the net.rim.device.api.ui.component.EditField class.
2.
Create an instance of an EditField.
EditField edit = new EditField("EditField: ", "", 10,
EditField.FILTER_DEFAULT);

Create a password field

1.
Import the net.rim.device.api.ui.component.PasswordEditField class.
2.
Create an instance of a PasswordEditField.
For example, the following instance uses a constructor that lets you provide a default initial value for the
PasswordEditField:
PasswordEditField pwd = new PasswordEditField("PasswordEditField: ", "");

Create a text field for AutoText

1.
Import the following classes:
• net.rim.device.api.ui.component.AutoTextEditField
• net.rim.device.api.ui.autotext.AutoText
20
UI components

Advertisement

Table of Contents
loading

This manual is also suitable for:

Java development environment

Table of Contents