|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjcontrol.ui.vole.Component
jcontrol.ui.vole.Label
public class Label
A label is a very simple component which displays non-editable text or an image resource. Labels cannot gain the input focus.
(c) Copyright 2003-2005 DOMOLOGIC GmbH
| Field Summary | |
|---|---|
static int |
ALIGN_CENTER
Align text to the middle |
static int |
ALIGN_LEFT
Align text to the right |
static int |
ALIGN_RIGHT
Align text to the right |
| Fields inherited from class jcontrol.ui.vole.Component |
|---|
eventQueue, focusOwner, font, g, height, listener, parent, visible, width, x, y |
| Constructor Summary | |
|---|---|
Label(Object label,
int x,
int y)
Construct a new label with x- and y-coordinate. |
|
Label(Object label,
int x,
int y,
int width,
int height,
int align)
Constructs a new label with specified bounds and alignment. |
|
Label(String label,
int x,
int y,
int align)
Construct a new label with specified alignment. |
|
| Method Summary | |
|---|---|
void |
paint()
Paint the label. |
void |
setAlign(int align,
boolean revalidate)
Set the alignment of the label. |
void |
setLabel(Object label,
boolean revalidate)
Set a new label to display. |
boolean |
transferFocus()
Label can't gain input focus. |
void |
validate()
Compute this component's preferred size and assign internal values width and height. |
| Methods inherited from class jcontrol.ui.vole.Component |
|---|
getBounds, getParent, isVisible, onActionEvent, onKeyEvent, remove, removeFocus, requestFocus, setBounds, setFont, setGraphics, setParent, setVisible |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, notifyAll, wait |
| Field Detail |
|---|
public static final int ALIGN_CENTER
public static final int ALIGN_LEFT
public static final int ALIGN_RIGHT
| Constructor Detail |
|---|
public Label(Object label,
int x,
int y)
label - A String or an image resource to print on the label.x - the x-coordinate of the label's top-left cornery - the y-coordinate of the label's top-left corner
public Label(Object label,
int x,
int y,
int width,
int height,
int align)
label - the label to display on the labelx - the x-coordinate of the label's top-left cornery - the y-coordinate of the label's top-left cornerwidth - the width of the labelheight - the height of the labelalign - the horizontal alignment of the label. Possible values are
ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT
public Label(String label,
int x,
int y,
int align)
text - A String or an image resource to print on the label.x - the x-coordinate of the label's top-left cornery - the y-coordinate of the label's top-left corneralign - the horizontal alignment of the text. Possible values are
ALIGN_LEFT, ALIGN_CENTER and ALIGN_RIGHT| Method Detail |
|---|
public void paint()
paint in class Component
public void setAlign(int align,
boolean revalidate)
align - The horizontal alignment of the label.revalidate - If true, the display area will be cleared before repainting.
public void setLabel(Object label,
boolean revalidate)
label - The new label (string or image resource).revalidate - If true, the display area will be cleared before repainting.public boolean transferFocus()
transferFocus in class Componentpublic void validate()
validate in class Component
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||