TextBox
class is a Screen
that allows the user to enter and edit text. A TextBox
has a maximum size, which is the maximum number of characters that can be stored in the object at any time (its capacity). This limit is enforced when the TextBox
instance is constructed, when the user is editing text within the TextBox
, as well as when the application program calls methods on the TextBox
that modify its contents. The maximum size is the maximum stored capacity and is unrelated to the number of characters that may be displayed at any given time. The number of characters displayed and their arrangement into rows and columns are determined by the device.
The implementation may place a boundary on the maximum size, and the maximum size actually assigned may be smaller than the application had requested. The value actually assigned will be reflected in the value returned by {@link #getMaxSize() getMaxSize()}. A defensively-written application should compare this value to the maximum size requested and be prepared to handle cases where they differ.
The text contained within a TextBox
may be more than can be displayed at one time. If this is the case, the implementation will let the user scroll to view and edit any part of the text. This scrolling occurs transparently to the application.
If the constraints are set to {@link TextField#ANY}The text may contain line breaks. The display of the text must break accordingly and the user must be able to enter line break characters.
TextBox
has the concept of input constraints that is identical to TextField
. The constraints
parameters of methods within the TextBox
class use constants defined in the {@link TextField TextField}class. See the description of input constraints in the TextField
class for the definition of these constants. TextBox
also has the same notions as TextField
of the actual contents and the displayed contents, described in the same section.
TextBox
also has the concept of input modes that is identical to TextField
. See the description of input modes in the TextField
class for more details.
@since MIDP 1.0
Contains the text in a text frame as well as the properties and methods that control alignment and anchoring of the text.
@author Yegor KozlovSee Specification.
Default {@link #getZclass}: z-textbox.(since 3.5.0) @author tomyeh
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|