|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmobilecore.ui.core.Component
com.jmobilecore.ui.core.Label
public class Label
Provides a text label for display on the screen. A label is not focusable.
Field Summary | |
---|---|
protected java.lang.String |
text
The text of this label. |
Fields inherited from class com.jmobilecore.ui.core.Component |
---|
alignment, background, CENTER, focusable, focusedBackground, focusedForeground, font, foreground, height, isCompletelyVisible, isFocused, isVisible, LEFT, parentScreen, RIGHT, screenY, valid, width |
Constructor Summary | |
---|---|
Label(java.lang.String text)
Constructs a new label with the specified string of text, left justified. |
|
Label(java.lang.String text,
javax.microedition.lcdui.Font font,
int alignment)
Constructs a new label that presents the specified string of text with the specified alignment. |
|
Label(java.lang.String text,
int alignment)
Constructs a new label that presents the specified string of text with the specified alignment. |
Method Summary | |
---|---|
static Label |
createTitleLabel(java.lang.String titleText)
Creates title label |
java.lang.String |
getText()
Gets the text of this label. |
void |
paint(javax.microedition.lcdui.Graphics g)
Paints the label to the screen. |
void |
setText(java.lang.String text)
Sets the text for this label to the specified text. |
Methods inherited from class com.jmobilecore.ui.core.Component |
---|
destructor, getBackground, getFont, getForeground, getHeight, getWidth, invalidate, isFocusOwner, keyPressed, keyReleased, keyRepeated, paintBackground, pointerDragged, pointerPressed, pointerReleased, prepareForeground, releaseFocus, requestFocus, setFont, setHeight |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String text
getText()
,
setText(String)
Constructor Detail |
---|
public Label(java.lang.String text)
text
- the string that the label presents.
A null
value
will be accepted without causing a NullPointerException
to be thrown.
The text can be single line only. If text contains
\n characters (used to indicate line breaks) then it might overlap with other UI components.
It is up to the caller to ensure correctness of input stringpublic Label(java.lang.String text, javax.microedition.lcdui.Font font, int alignment)
alignment
are Label.LEFT
,
Label.RIGHT
, and Label.CENTER
.
text
- the string that the label presents.
A null
value
will be accepted without causing a NullPointerException
to be thrown.
The text can be single line only. If text contains
\n characters (used to indicate line breaks) then it might overlap with other UI components.
It is up to the caller to ensure correctness of input stringfont
- the label fontalignment
- the alignment value.public Label(java.lang.String text, int alignment)
alignment
are Label.LEFT
,
Label.RIGHT
, and Label.CENTER
.
text
- the string that the label presents.
A null
value
will be accepted without causing a NullPointerException
to be thrown.
The text can be single line only. If text contains
\n characters (used to indicate line breaks) then it might overlap with other UI components.
It is up to the caller to ensure correctness of input stringalignment
- the alignment value.Method Detail |
---|
public static Label createTitleLabel(java.lang.String titleText)
titleText
- The title text
ScreenCanvas
Label
public java.lang.String getText()
null
if
the text has been set to null
.setText(java.lang.String)
public void paint(javax.microedition.lcdui.Graphics g)
paint
in class Component
g
- The Graphics object to render to.public void setText(java.lang.String text)
text
- the text that this label displays.getText()
|
jMobileCore toolkit | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |