|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--waba.ui.Control
|
+--waba.ui.Label
Label is a text label control. It supports multiline, but you need to separate the text with |.
Here is an example showing a label being used:
public class MyProgram extends MainWindow
{
public void onStart()
{
Label label = new Label("Value:");
label.setRect(10, 10, 80, 30);
add(label);
}
| Field Summary | |
static int |
CENTER
Constant for center alignment. |
static int |
LEFT
Constant for left alignment. |
static int |
RIGHT
Constant for right alignment. |
| Fields inherited from class waba.ui.Control |
BOTTOM,
CENTER,
controlCount,
enabled,
FILL,
fm,
font,
height,
LEFT,
name,
next,
parent,
PREFERRED,
prev,
RIGHT,
TOP,
width,
x,
y |
| Constructor Summary | |
Label(java.lang.String text)
Creates a label displaying the given text with left alignment. supports inverted text, multiple lines and is scrollable |
|
Label(java.lang.String text,
int align)
Creates a label displaying the given text with the given alignment. |
|
| Method Summary | |
int |
getPreferredHeight()
returns the preffered width of this control. added by guich |
int |
getPreferredWidth()
returns the preffered width of this control. added by guich |
java.lang.String |
getText()
Gets the text that is displayed in the label. |
protected void |
onBoundsChanged()
called after an setRect. added by guich |
void |
onPaint(Graphics g)
Called by the system to draw the button. |
static java.lang.String[] |
parseText(java.lang.String text,
char delim)
returns the parsed text |
boolean |
scroll(boolean down)
scroll one page. returns true if success, false if no scroll possible |
void |
setInvert(boolean on)
if invert is true, the background is filled with black and the letters are drawn white |
void |
setText(java.lang.String text)
Sets the text that is displayed in the label. |
java.lang.String |
toString()
Returns the string representation of the object. |
| Methods inherited from class waba.ui.Control |
addTimer,
contains,
createGraphics,
getAbsoluteRect,
getFontMetrics,
getNext,
getParent,
getRect,
isEnabled,
isVisible,
onEvent,
onWindowPaintFinished,
postEvent,
removeTimer,
repaint,
repaintNow,
setEnabled,
setFont,
setRect,
setRect,
setVisible |
| Methods inherited from class java.lang.Object |
hashCode |
| Field Detail |
public static final int LEFT
public static final int CENTER
public static final int RIGHT
| Constructor Detail |
public Label(java.lang.String text)
public Label(java.lang.String text,
int align)
text - the text displayedalign - the alignmentLEFT,
RIGHT,
CENTER| Method Detail |
public void setInvert(boolean on)
public void setText(java.lang.String text)
public java.lang.String getText()
public static java.lang.String[] parseText(java.lang.String text,
char delim)
public int getPreferredWidth()
public int getPreferredHeight()
protected void onBoundsChanged()
public boolean scroll(boolean down)
public void onPaint(Graphics g)
g - the graphics object for drawingGraphicspublic java.lang.String toString()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||