public class BLabel extends Widget
Modifier and Type | Class and Description |
---|---|
static class |
BLabel.Position
This inner class represents a value for the alignment or text position.
|
Modifier and Type | Field and Description |
---|---|
static BLabel.Position |
CENTER |
static BLabel.Position |
EAST |
static BLabel.Position |
NORTH |
static BLabel.Position |
NORTHEAST |
static BLabel.Position |
NORTHWEST |
static BLabel.Position |
SOUTH |
static BLabel.Position |
SOUTHEAST |
static BLabel.Position |
SOUTHWEST |
static BLabel.Position |
WEST |
Constructor and Description |
---|
BLabel()
Create a new BLabel with no text or image.
|
BLabel(javax.swing.Icon image)
Create a new BLabel which displays an image.
|
BLabel(javax.swing.Icon image,
BLabel.Position align)
Create a new BLabel which displays an image.
|
BLabel(java.lang.String text)
Create a new BLabel which displays text.
|
BLabel(java.lang.String text,
BLabel.Position align)
Create a new BLabel which displays text.
|
BLabel(java.lang.String text,
javax.swing.Icon image,
BLabel.Position align,
BLabel.Position textPos)
Create a new BLabel which displays both text and an image.
|
Modifier and Type | Method and Description |
---|---|
BLabel.Position |
getAlignment()
Get the alignment of the label's contents.
|
javax.swing.JLabel |
getComponent()
Get the java.awt.Component corresponding to this Widget.
|
javax.swing.Icon |
getIcon()
Get the image which appears on this label.
|
java.awt.Dimension |
getMaximumSize()
Get the largest size at which this Widget can reasonably be drawn.
|
java.lang.String |
getText()
Get the text which appears on this label.
|
BLabel.Position |
getTextPosition()
Get the position of the text relative to the image.
|
void |
setAlignment(BLabel.Position alignment)
Set the alignment of the label's contents.
|
void |
setIcon(javax.swing.Icon image)
Set the image which appears on this label.
|
void |
setText(java.lang.String text)
Set the text which appears on this label.
|
void |
setTextPosition(BLabel.Position position)
Set the position of the text relative to the image.
|
addEventLink, dispatchEvent, getBackground, getBounds, getCursor, getFont, getMinimumSize, getName, getParent, getPreferredSize, hasFocus, isEnabled, isFocusable, isVisible, repaint, requestFocus, setBackground, setCursor, setEnabled, setFocusable, setFont, setName, setVisible
addEventLink, addEventLink, removeEventLink
public static final BLabel.Position CENTER
public static final BLabel.Position NORTH
public static final BLabel.Position SOUTH
public static final BLabel.Position WEST
public static final BLabel.Position EAST
public static final BLabel.Position NORTHEAST
public static final BLabel.Position SOUTHEAST
public static final BLabel.Position NORTHWEST
public static final BLabel.Position SOUTHWEST
public BLabel()
public BLabel(java.lang.String text)
text
- the text to display on the BLabelpublic BLabel(java.lang.String text, BLabel.Position align)
text
- the text to display on the BLabelalign
- the alignment of the label contents (CENTER, NORTH, NORTHEAST, etc.)public BLabel(javax.swing.Icon image)
image
- the image to display on the BLabelpublic BLabel(javax.swing.Icon image, BLabel.Position align)
image
- the image to display on the BLabelalign
- the alignment of the label contents (CENTER, NORTH, NORTHEAST, etc.)public BLabel(java.lang.String text, javax.swing.Icon image, BLabel.Position align, BLabel.Position textPos)
text
- the text to display on the BLabelimage
- the image to display on the BLabelalign
- the alignment of the label contents (CENTER, NORTH, NORTHEAST, etc.)textPos
- the position of the text relative to the image (CENTER, NORTH, NORTHEAST, etc.)public javax.swing.JLabel getComponent()
Widget
getComponent
in class Widget
public java.lang.String getText()
public void setText(java.lang.String text)
public javax.swing.Icon getIcon()
public void setIcon(javax.swing.Icon image)
public java.awt.Dimension getMaximumSize()
getMaximumSize
in class Widget
public BLabel.Position getAlignment()
public void setAlignment(BLabel.Position alignment)
public BLabel.Position getTextPosition()
public void setTextPosition(BLabel.Position position)
Written by Peter Eastman.