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.

Labels

Use a label to display text that identifies a control.


This screen shows a label.

Best practice: Implementing labels

  • Use the LabelField class to create labels.
  • Use clear, concise labels.
  • Group and order labels logically (for example, group related items together or include the most common items first). Avoid ordering values alphabetically; alphabetical order is language specific.
  • Punctuate the label with a colon (:).

Create a text label

  1. Import the net.rim.device.api.ui.component.LabelField class.

  2. Create an instance of a LabelField to add a text label to a screen.

    LabelField title = new LabelField("UI Component Sample", LabelField.ELLIPSIS);