|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mwt.Component mwt.Label
public class Label
A label object is a component for displaying text or an image.
The text can be changed by the application, but the user cannot edit it directly.
Field Summary | |
---|---|
static int |
STYLE_DEFAULT
Constant value to get/set a skin/font. |
static int |
STYLE_DISABLED
Constant value to get/set a skin/font. |
Fields inherited from class mwt.Component |
---|
ALIGN_BOTTOM_CENTER, ALIGN_BOTTOM_LEFT, ALIGN_BOTTOM_RIGHT, ALIGN_MIDDLE_CENTER, ALIGN_MIDDLE_LEFT, ALIGN_MIDDLE_RIGHT, ALIGN_TOP_CENTER, ALIGN_TOP_LEFT, ALIGN_TOP_RIGHT |
Constructor Summary | |
---|---|
Label(int x,
int y,
javax.microedition.lcdui.Image image)
Creates a new image label. |
|
Label(int x,
int y,
int width,
int height,
java.lang.String text)
Creates a new text label. |
Method Summary | |
---|---|
static Font |
getDefaultFont(int style)
Gets the default font for the given style. |
Font |
getFont(int style)
Gets this label font for the given style. |
javax.microedition.lcdui.Image |
getImage()
Gets the image, or null if this component is a text label. |
java.lang.String |
getText()
Gets this label's text. |
int |
getTextAlign()
Gets the text align. |
protected void |
paint(javax.microedition.lcdui.Graphics g,
Window window)
Paints this component. |
static void |
setDefaultFont(int style,
Font font)
Sets the default font for the given style. |
void |
setFont(int style,
Font font)
Sets this label font for the given style. |
void |
setImage(javax.microedition.lcdui.Image image)
Sets the image, or null if this component is a text label. |
void |
setText(java.lang.String text)
Sets this label's text. |
void |
setTextAlign(int textAlign)
Sets the text align. |
Methods inherited from class mwt.Component |
---|
acceptsFocus, add, add, focusGained, focusLost, getChild, getChild, getChild, getChildCount, getComponent, getComponentCount, getComponentIndex, getHeight, getId, getParent, getWidth, getX, getY, isContainer, isDoubleBuffered, isEnabled, isFocusable, isHierarchyEnabled, isHierarchyVisible, isVisible, keyEvent, paintChilds, remove, removeChild, setDoubleBuffered, setEnabled, setFocusable, setHeight, setId, setVisible, setWidth, setX, setY |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int STYLE_DEFAULT
public static final int STYLE_DISABLED
Constructor Detail |
---|
public Label(int x, int y, int width, int height, java.lang.String text)
public Label(int x, int y, javax.microedition.lcdui.Image image)
Method Detail |
---|
public static final Font getDefaultFont(int style)
public static final void setDefaultFont(int style, Font font)
public Font getFont(int style)
public void setFont(int style, Font font)
public java.lang.String getText()
public void setText(java.lang.String text)
public int getTextAlign()
public void setTextAlign(int textAlign)
public javax.microedition.lcdui.Image getImage()
public final void setImage(javax.microedition.lcdui.Image image)
protected void paint(javax.microedition.lcdui.Graphics g, Window window)
Component
The default implementation calls Component.paintChilds(Graphics, Window)
.
An implementation should call Component.paintChilds(Graphics, Window)
once (if the
component is a container).
The graphics object was previously transformed to the current x and y, and the clip was setted according to this component width and height.
paint
in class Component
g
- the graphics to draw the component intowindow
- the window caller
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |