|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.awt.Component | +--jwo.utils.JWLabel
Label with user-defined borders for compact text.
Nested Class Summary |
Nested classes inherited from class java.awt.Component |
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
JWLabel()
Creates a blank label (can be used for padding). |
|
JWLabel(String text)
Creates a label with the given text. |
|
JWLabel(String text,
int align)
Creates a label with the given text and alignment. |
Method Summary | |
Dimension |
getMaximumSize()
Reports the maximum size of the label. |
Dimension |
getMinimumSize()
Reports the minimum size of the label. |
Dimension |
getPreferredSize()
Reports the preferred size of the label. |
void |
paint(Graphics g)
Draws the label on the component. |
void |
setPadding(int padx,
int pady)
Sets the padding values for the label. |
void |
setText(String newText)
Sets the label text. |
String |
toString()
Reports the details of this label. |
void |
update(Graphics g)
Updates the component without redrawing the background. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public JWLabel()
public JWLabel(String text)
text
- Text to display in label.public JWLabel(String text, int align)
text
- Text to display in label.align
- Alignment (Label.LEFT, Label.CENTER, Label.RIGHT).Method Detail |
public void paint(Graphics g)
paint
in class Component
g
- Graphics context to paint to.public final void update(Graphics g)
update
in class Component
public Dimension getMaximumSize()
getMaximumSize
in class Component
public Dimension getMinimumSize()
getMinimumSize
in class Component
public final Dimension getPreferredSize()
getPreferredSize
in class Component
public void setPadding(int padx, int pady)
padx
- X padding in pixels.pady
- Y padding in pixels.public void setText(String newText)
newText
- New label text.public String toString()
toString
in class Component
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |