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
- Download the file
- In the IDE, open the custom_manager.jdw workspace
- Open the DiagonalApp.java source file.
- Open the DiagonalManager.java source file.
Tasks
- Implement DiagonalManager's getPreferredWidth and getPreferredHeight methods so that they define the size of the manager.
- Fill in the loop of DiagonalManager's sublayout method so that each controlled field gets layed out and arranged.
- 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
|