Slide 3.11: Line-by-line anatomy of HelloMIDlet.java (cont.) Slide 3.13: Line-by-line anatomy of HelloMIDlet.java (cont.) Home |
HelloMIDlet.java
(Cont.)
tbxMain = new TextBox("HelloMIDlet", "Hello, World!", 50, 0);
TextBox
object with the following parameters:
title
— The title text is to be shown with the display.
text
— The initial contents of the text editing area.
If the text parameter is null, the TextBox
is created empty.
maxSize
— The maximum capacity in characters, which must be greater than zero.
constraints
— The different constraints allow the application to request that the user's input be restricted in a variety of ways.
Constant 0 is assigned to public static final int ANY
, which allows users to enter any text.
Other constraints can be found from the Field Summary of input constraints.
tbxMain.addCommand(cmdExit);
tbxMain.setCommandListener(this);
Commands
to this Displayable
, replacing any previous CommandListener
.
public void startApp( ) {
Active
state after the application manager calls startApp( )
via clicking on the button Launch
.