|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--java.awt.Label
A component that displays a single line of read-only text.
Field Summary | |
static int |
CENTER
The center alignment. |
static int |
LEFT
The left alignment. |
static int |
RIGHT
The right alignment. |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
Label()
Constructs an empty label. |
|
Label(String label)
Constructs a new label with the specified String of text. |
|
Label(String label,
int alignment)
Constructs a new label with the specified String of text and the specified alignment. |
Method Summary | |
void |
addNotify()
Creates the peer for this label. |
int |
getAlignment()
Gets the current alignment of this label. |
String |
getText()
Gets the text of this label. |
protected String |
paramString()
Returns the parameter String of this label. |
void |
setAlignment(int alignment)
Sets the alignment for this label to the specified alignment. |
void |
setText(String label)
Sets the text for this label to the specified text. |
Methods inherited from class java.awt.Component |
action, bounds, checkImage, checkImage, createImage, createImage, deliverEvent, disable, enable, enable, getBackground, getColorModel, getFont, getFontMetrics, getForeground, getGraphics, getParent, getPeer, getToolkit, gotFocus, handleEvent, hide, imageUpdate, inside, invalidate, isEnabled, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paint, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, removeNotify, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setFont, setForeground, show, show, size, toString, update, validate |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int LEFT
public static final int CENTER
public static final int RIGHT
Constructor Detail |
public Label()
public Label(String label)
label
- the text that makes up the labelpublic Label(String label, int alignment)
label
- the String that makes up the labelalignment
- the alignment valueMethod Detail |
public void addNotify()
addNotify
in class Component
Component.getPeer()
,
Component.removeNotify()
public int getAlignment()
setAlignment(int)
public void setAlignment(int alignment)
alignment
- the alignment value
IllegalArgumentException
- If an improper alignment was given.getAlignment()
public String getText()
setText(java.lang.String)
public void setText(String label)
label
- the text that makes up the labelgetText()
protected String paramString()
paramString
in class Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |