|
|||||||||
| Home >> All >> com >> javathis >> utilities >> [ ui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.javathis.utilities.ui
Class JTLabel

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JLabel
com.javathis.utilities.ui.JTLabel
- All Implemented Interfaces:
- javax.accessibility.Accessible, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.beans.PropertyChangeListener, java.io.Serializable, javax.swing.SwingConstants
- public class JTLabel
- extends javax.swing.JLabel
- implements java.beans.PropertyChangeListener
- extends javax.swing.JLabel
A JTLabel is a label that can provide a visual que that the
component that it is labeling is required.
The default required character is a red asterick. The color and character are customizable.
| Nested Class Summary |
| Nested classes inherited from class javax.swing.JLabel |
javax.swing.JLabel.AccessibleJLabel |
| Nested classes inherited from class javax.swing.JComponent |
javax.swing.JComponent.AccessibleJComponent |
| Nested classes inherited from class java.awt.Container |
java.awt.Container.AccessibleAWTContainer |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
private static char |
DEFAULT_REQUIRED_CHARACTER
|
private static java.awt.Color |
DEFAULT_REQUIRED_COLOR
|
private boolean |
isInit
|
private boolean |
isRequired
|
private static char |
REQUIRED_CHARACTER
|
private static java.awt.Color |
REQUIRED_COLOR
|
private java.lang.String |
unmodifiedText
|
private static java.util.Vector |
UPDATE_LABEL_LISTENERS
|
| Fields inherited from class javax.swing.JLabel |
labelFor |
| Fields inherited from class javax.swing.JComponent |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Container |
|
| Fields inherited from class java.awt.Component |
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Fields inherited from interface java.awt.image.ImageObserver |
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
JTLabel()
Creates a JTLabel instance with
no image and with an empty string for the title. |
|
JTLabel(javax.swing.Icon image)
Creates a JTLabel instance with the specified image. |
|
JTLabel(javax.swing.Icon image,
int horizontalAlignment)
Creates a JTLabel instance with the specified
image and horizontal alignment. |
|
JTLabel(java.lang.String text)
Creates a JTLabel instance with the specified text. |
|
JTLabel(java.lang.String text,
javax.swing.Icon icon,
int horizontalAlignment)
Creates a JTLabel instance with the specified
text, image, and horizontal alignment. |
|
JTLabel(java.lang.String text,
int horizontalAlignment)
Creates a JTLabel instance with the specified
text and horizontal alignment. |
|
| Method Summary | |
void |
destroy()
Automaticly called if GC calls finalize method. |
protected void |
finalize()
Called by the garbage collector when it determines that there are no more references to this object. |
char |
getRequiredCharacter()
|
static java.awt.Color |
getRequiredColor()
|
java.lang.String |
getText()
Returns the text string that the label displays. |
boolean |
isRequired()
|
void |
jtInit()
Automaticly called at construction. |
void |
propertyChange(java.beans.PropertyChangeEvent e)
Fired after a Bean's property has changed. |
void |
setRequired(boolean isRequired)
Marks the label as required or not, and updates it accordingly. |
void |
setRequiredCharacter(java.lang.Character requiredCharacter)
Provide the Character to use for signifying the component/field the label is for as a required component. |
void |
setRequiredColor(java.awt.Color requiredColor)
Provide the Color to use for the required character. |
void |
setText(java.lang.String text)
Defines the single line of text this component will display. |
protected void |
updateLabel()
Called internnally to notify the JTLabel that it's contents have changed, and needs to be updated. |
| Methods inherited from class java.lang.Object |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
DEFAULT_REQUIRED_CHARACTER
private static final char DEFAULT_REQUIRED_CHARACTER
- See Also:
- Constant Field Values
DEFAULT_REQUIRED_COLOR
private static final java.awt.Color DEFAULT_REQUIRED_COLOR
REQUIRED_CHARACTER
private static char REQUIRED_CHARACTER
REQUIRED_COLOR
private static java.awt.Color REQUIRED_COLOR
UPDATE_LABEL_LISTENERS
private static java.util.Vector UPDATE_LABEL_LISTENERS
isRequired
private boolean isRequired
isInit
private boolean isInit
unmodifiedText
private java.lang.String unmodifiedText
| Constructor Detail |
JTLabel
public JTLabel()
- Creates a
JTLabelinstance with no image and with an empty string for the title. The label is centered vertically in its display area. The label's contents, once set, will be displayed on the leading edge of the label's display area.
JTLabel
public JTLabel(javax.swing.Icon image)
- Creates a
JTLabelinstance with the specified image. The label is centered vertically and horizontally in its display area.
JTLabel
public JTLabel(javax.swing.Icon image, int horizontalAlignment)
- Creates a
JTLabelinstance with the specified image and horizontal alignment. The label is centered vertically in its display area.
JTLabel
public JTLabel(java.lang.String text)
- Creates a
JTLabelinstance with the specified text. The label is aligned against the leading edge of its display area, and centered vertically.
JTLabel
public JTLabel(java.lang.String text, int horizontalAlignment)
- Creates a
JTLabelinstance with the specified text and horizontal alignment. The label is centered vertically in its display area.
JTLabel
public JTLabel(java.lang.String text, javax.swing.Icon icon, int horizontalAlignment)
- Creates a
JTLabelinstance with the specified text, image, and horizontal alignment. The label is centered vertically in its display area. The text is on the trailing edge of the image.
| Method Detail |
jtInit
public void jtInit()
- Automaticly called at construction.
Can be called manually if you need to re-Init this component after it has
been destroyed. However, once it has been GC'd there is no guarantee as to
what will happen.
destroy
public void destroy()
- Automaticly called if GC calls finalize method.
However, this is not guaranteed, and if this component causes a memory
leak, it may need to be called manually, when needed.
setText
public void setText(java.lang.String text)
- Defines the single line of text this component will display. If
the value of text is null or empty string, nothing is displayed.
The default value of this property is null.
getText
public java.lang.String getText()
- Returns the text string that the label displays. Always without the
required character.
setRequiredCharacter
public void setRequiredCharacter(java.lang.Character requiredCharacter)
- Provide the Character to use for signifying the component/field the label
is for as a required component. The default is an asterick(*).
Note:
That all JTLabel's use the same character, therefore this method only needs to be called once to change it for all BTLabels. If a null Character is provided then it will reset the required character back to the default.
getRequiredCharacter
public char getRequiredCharacter()
setRequiredColor
public void setRequiredColor(java.awt.Color requiredColor)
- Provide the Color to use for the required character.
The default is red.
Note:
That all JTLabel's use the same color, therefore this method only needs to be called once to change it for all BTLabels. If a null Color is provided then it will reset the required color back to the default.
getRequiredColor
public static java.awt.Color getRequiredColor()
updateLabel
protected void updateLabel()
- Called internnally to notify the JTLabel that it's contents have changed,
and needs to be updated.
Note: Should not normally be called from an external source.
setRequired
public void setRequired(boolean isRequired)
- Marks the label as required or not, and updates it accordingly.
isRequired
public boolean isRequired()
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent e)
- Description copied from interface:
java.beans.PropertyChangeListener - Fired after a Bean's property has changed.
- Specified by:
propertyChangein interfacejava.beans.PropertyChangeListener
finalize
protected void finalize()
throws java.lang.Throwable
- Called by the garbage collector when it determines that there are no more
references to this object. Overrided to dispose of system resources and
to perform cleanup on this object.
|
|||||||||
| Home >> All >> com >> javathis >> utilities >> [ ui overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC