Motorola T720 Developer's Manual page 53

Hide thumbs Also See for T720:
Table of Contents

Advertisement

Coding Example
Step 1: Change a button's offset scheme
Locate the code for the fifth button, b5, in the ButtonScreen's constructor. Uncomment the
statement:
// b5.setLeftEdge(Component.PREVIOUS_COMPONENT_RIGHT, 0);
What this statement does is offsets b5's left edge to the right edge of the previous
component, which is the round button b4.
Step 2: Build and start the program under debugger control
Issue the Debug command (Project | Debug) to have CodeWarrior's IDE make the
program and start the debugger.
Step 3: Observe the effect of the new offset scheme
Issue a Run command (Project | Run) to have the MIDlet execute in the debugger. Note
that the location of the second round button, b5, has changed
Use the navigation button to move the focus ownership so that the second round button
has focus (Figure 22).
Figure 22.
The second round button appears relative to the first round button's right edge. However,
the vertical offset scheme is still in effect: this button's top edge is located relative to the
first round button's bottom edge.
Use the Exit soft key to terminate the MIDlet and end the debugger session.
Step 4: Change another offset scheme for this button
Use the editor to uncomment the statement:
//
The second round button, using an offset where the button's left edge is
relative to the first round button's right edge.
b5.setTopEdge(Component.PREVIOUS_COMPONENT_TOP, 0);
53

Advertisement

Table of Contents
loading

Table of Contents