waba.ui
Class Label

waba.lang.Object
  |
  +--waba.ui.Control
        |
        +--waba.ui.Label

public class Label
extends Control

Label is a text label control.

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
height, next, parent, prev, width, x, y
 
Constructor Summary
Label(String text)
          Creates a label displaying the given text with left alignment.
Label(String text, int align)
          Creates a label displaying the given text with the given alignment.
 
Method Summary
 String getText()
          Gets the text that is displayed in the label.
 void onPaint(Graphics g)
          Called by the system to draw the button.
 void setText(String text)
          Sets the text that is displayed in the label.
 
Methods inherited from class waba.ui.Control
addTimer, contains, createGraphics, getFontMetrics, getNext, getParent, getRect, onEvent, postEvent, removeTimer, repaint, setRect
 
Methods inherited from class waba.lang.Object
toString
 

Field Detail

LEFT

public static final int LEFT
Constant for left alignment.

CENTER

public static final int CENTER
Constant for center alignment.

RIGHT

public static final int RIGHT
Constant for right alignment.
Constructor Detail

Label

public Label(String text)
Creates a label displaying the given text with left alignment.

Label

public Label(String text,
             int align)
Creates a label displaying the given text with the given alignment.
Parameters:
text - the text displayed
align - the alignment
See Also:
LEFT, RIGHT, CENTER
Method Detail

setText

public void setText(String text)
Sets the text that is displayed in the label.

getText

public String getText()
Gets the text that is displayed in the label.

onPaint

public void onPaint(Graphics g)
Called by the system to draw the button.
Overrides:
onPaint in class Control
Tags copied from class: Control
Parameters:
g - the graphics object for drawing
See Also:
Graphics