BlackBerry
Skip Top Navigation
Developers Partners
North America [change region] Products Solutions Purchasing Support
Developers


Introduction to User Interface Managers

Exercise

Create an application that uses a custom User Interface (UI) manager. This manager lays out its fields on a diagonal and manipulates the natural focus order.

Objectives

  • Discover how to create a custom UI component.
  • Discover how UI managers control field layout and handle focus events.

Setup

  1. Download the file
  2. In the IDE, open the custom_manager.jdw workspace
  3. Open the DiagonalApp.java source file.
  4. Open the DiagonalManager.java source file.

Tasks

  1. Implement DiagonalManager's getPreferredWidth and getPreferredHeight methods so that they define the size of the manager.
  2. Fill in the loop of DiagonalManager's sublayout method so that each controlled field gets layed out and arranged.
  3. Complete DiagonalManager's nextFocus method so that focus does not leave the manager.

Check Your Work

Download the completed code

Review

In this exercise, you discovered the following things:

  • how to create a custom UI component.
  • how UI managers control field layout and handle focus events.


Additional Labs

Go to the next exercise in “Developing User Interfaces for BlackBerry”, Displaying a list of complex records

Back to the Developer Lab Main Menu

 
Other Resources
 
     
 Home | Products | Solutions | Purchasing | Support | Developers | Worldwide | News | About Us | Contact Us | Site Map
 Legal | Copyright © 2008 Research In Motion Limited, unless otherwise noted.