javax.swing
Class JLabel

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--javax.swing.JLabel
All Implemented Interfaces:
Accessible, java.awt.image.ImageObserver, MenuContainer, Serializable, SwingConstants
Direct Known Subclasses:
DefaultListCellRenderer, javax.swing.table.DefaultTableCellRenderer

public class JLabel
extends JComponent
implements SwingConstants, Accessible

Safe: A display area for a short text string or an image, or both. A label does not react to input events. As a result, it cannot get the keyboard focus. A label can, however, display a keyboard alternative as a convenience for a nearby component that has a keyboard alternative but can't display it.

A JLabel object can display either text, an image, or both. You can specify where in the label's display area the label's contents are aligned by setting the vertical and horizontal alignment. By default, labels are vertically centered in their display area. Text-only labels are leading edge aligned, by default; image-only labels are horizontally centered, by default.

You can also specify the position of the text relative to the image. By default, text is on the trailing edge of the image, with the text and image vertically aligned.

A label's leading and trailing edge are determined from the value of its java.awt.ComponentOrientation property. At present, the default ComponentOrientation setting maps the leading edge to left and the trailing edge to right.

Finally, you can use the setIconTextGap method to specify how many pixels should appear between the text and the image. The default is 4 pixels.

See How to Use Labels in The Java Tutorial for further documentation.

Warning: Serialized objects of this class will not be compatible with future Swing releases. The current serialization support is appropriate for short term storage or RMI between applications running the same version of Swing. As of 1.4, support for long term storage of all JavaBeansTM has been added to the java.beans package. Please see java.beans.XMLEncoder.

Version:
1.111 04/12/02
Author:
Hans Muller
See Also:
Serialized Form

Field Summary
private  AccessibleIcon accessibleIcon
           
private  Icon defaultIcon
           
private  Icon disabledIcon
           
private  boolean disabledIconSet
           
private  int horizontalAlignment
           
private  int horizontalTextPosition
           
private  int iconTextGap
           
(package private) static String LABELED_BY_PROPERTY
          Client property key used to determine what label is labeling the component.
protected  Component labelFor
           
private  int mnemonic
           
private  int mnemonicIndex
           
private  String text
           
private static String uiClassID
           
private  int verticalAlignment
           
private  int verticalTextPosition
           
 
Fields inherited from class javax.swing.JComponent
_bounds, accessibleContext, listenerList, paintingChild, 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
 
Constructor Summary
JLabel()
          Enabled: Creates a JLabel instance with no image and with an empty string for the title.
JLabel(Icon image)
          Enabled: Creates a JLabel instance with the specified image.
JLabel(Icon image, int horizontalAlignment)
          Enabled: Creates a JLabel instance with the specified image and horizontal alignment.
JLabel(String text)
          Enabled: Creates a JLabel instance with the specified text.
JLabel(String text, Icon icon, int horizontalAlignment)
          Enabled: Creates a JLabel instance with the specified text, image, and horizontal alignment.
JLabel(String text, int horizontalAlignment)
          Enabled: Creates a JLabel instance with the specified text and horizontal alignment.
 
Method Summary
protected  int checkHorizontalKey(int key, String message)
          Verify that key is a legal value for the horizontalAlignment properties.
protected  int checkVerticalKey(int key, String message)
          Verify that key is a legal value for the verticalAlignment or verticalTextPosition properties.
 AccessibleContext getAccessibleContext()
          Suppressed: Get the AccessibleContext of this object
 Icon getDisabledIcon()
          Enabled: Returns the value of the disabledIcon property if it's been set, If it hasn't been set and the value of the icon property is an ImageIcon, we compute a "grayed out" version of the icon and update the disabledIcon property with that.
 int getDisplayedMnemonic()
          Enabled: Return the keycode that indicates a mnemonic key.
 int getDisplayedMnemonicIndex()
          Enabled: Returns the character, as an index, that the look and feel should provide decoration for as representing the mnemonic character.
 int getHorizontalAlignment()
          Enabled: Returns the alignment of the label's contents along the X axis.
 int getHorizontalTextPosition()
          Enabled: Returns the horizontal position of the label's text, relative to its image.
 Icon getIcon()
          Enabled: Returns the graphic image (glyph, icon) that the label displays.
 int getIconTextGap()
          Enabled: Returns the amount of space between the text and the icon displayed in this label.
 Component getLabelFor()
          Enabled: Get the component this is labelling.
 String getText()
          Enabled: Returns the text string that the label displays.
 javax.swing.plaf.LabelUI getUI()
          Suppressed: Returns the L&F object that renders this component.
 String getUIClassID()
          Suppressed: Returns a string that specifies the name of the l&f class that renders this component.
 int getVerticalAlignment()
          Enabled: Returns the alignment of the label's contents along the Y axis.
 int getVerticalTextPosition()
          Enabled: Returns the vertical position of the label's text, relative to its image.
 boolean imageUpdate(Image img, int infoflags, int x, int y, int w, int h)
          Enabled: This is overridden to return false if the current Icon's Image is not equal to the passed in Image img.
protected  String paramString()
          Returns a string representation of this JLabel.
 void setDisabledIcon(Icon disabledIcon)
          Enabled: Set the icon to be displayed if this JLabel is "disabled" (JLabel.setEnabled(false)).
 void setDisplayedMnemonic(char aChar)
          Enabled: Specifies the displayedMnemonic as a char value.
 void setDisplayedMnemonic(int key)
          Enabled: Specify a keycode that indicates a mnemonic key.
 void setDisplayedMnemonicIndex(int index)
          Enabled: Provides a hint to the look and feel as to which character in the text should be decorated to represent the mnemonic.
 void setHorizontalAlignment(int alignment)
          Enabled: Sets the alignment of the label's contents along the X axis.
 void setHorizontalTextPosition(int textPosition)
          Enabled: Sets the horizontal position of the label's text, relative to its image.
 void setIcon(Icon icon)
          Enabled: Defines the icon this component will display.
 void setIconTextGap(int iconTextGap)
          Enabled: If both the icon and text properties are set, this property defines the space between them.
 void setLabelFor(Component c)
          Enabled: Set the component this is labelling.
 void setText(String text)
          Enabled: Defines the single line of text this component will display.
 void setUI(javax.swing.plaf.LabelUI ui)
          Suppressed: Sets the L&F object that renders this component.
 void setVerticalAlignment(int alignment)
          Enabled: Sets the alignment of the label's contents along the Y axis.
 void setVerticalTextPosition(int textPosition)
          Enabled: Sets the vertical position of the label's text, relative to its image.
 void updateUI()
          Suppressed: Resets the UI property to a value from the current look and feel.
private  void writeObject(ObjectOutputStream s)
          See readObject() and writeObject() in JComponent for more information about serialization in Swing.
 
Methods inherited from class javax.swing.JComponent
_paintImmediately, addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, alwaysOnTop, checkIfChildObscuredBySibling, componentInputMapChanged, computeVisibleRect, computeVisibleRect, compWriteObjectNotify, contains, createToolTip, disable, enable, enableSerialization, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getCreatedDoubleBuffer, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getManagingFocusBackwardTraversalKeys, getManagingFocusForwardTraversalKeys, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getWriteObjCounter, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyBindings, processKeyBindingsForAllComponents, processKeyEvent, processMouseMotionEvent, putClientProperty, rectangleIsObscured, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setCreatedDoubleBuffer, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPaintingChild, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, setWriteObjCounter, shouldDebugGraphics, superProcessMouseMotionEvent, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, get, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, iterate, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, size, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, toString, transferFocus, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uiClassID

private static final String uiClassID
See Also:
getUIClassID(), JComponent.readObject(java.io.ObjectInputStream)

mnemonic

private int mnemonic

mnemonicIndex

private int mnemonicIndex

text

private String text

defaultIcon

private Icon defaultIcon

disabledIcon

private Icon disabledIcon

disabledIconSet

private boolean disabledIconSet

verticalAlignment

private int verticalAlignment

horizontalAlignment

private int horizontalAlignment

verticalTextPosition

private int verticalTextPosition

horizontalTextPosition

private int horizontalTextPosition

iconTextGap

private int iconTextGap

labelFor

protected Component labelFor

accessibleIcon

private AccessibleIcon accessibleIcon

LABELED_BY_PROPERTY

static final String LABELED_BY_PROPERTY
Client property key used to determine what label is labeling the component. This is generally not used by labels, but is instead used by components such as text areas that are being labeled by labels. When the labelFor property of a label is set, it will automatically set the LABELED_BY_PROPERTY of the component being labelled.

See Also:
setLabelFor(java.awt.Component)
Constructor Detail

JLabel

public JLabel(String text,
              Icon icon,
              int horizontalAlignment)
Enabled: Creates a JLabel instance 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.

Parameters:
text - The text to be displayed by the label.
icon - The image to be displayed by the label.
horizontalAlignment - One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.

JLabel

public JLabel(String text,
              int horizontalAlignment)
Enabled: Creates a JLabel instance with the specified text and horizontal alignment. The label is centered vertically in its display area.

Parameters:
text - The text to be displayed by the label.
horizontalAlignment - One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.

JLabel

public JLabel(String text)
Enabled: Creates a JLabel instance with the specified text. The label is aligned against the leading edge of its display area, and centered vertically.

Parameters:
text - The text to be displayed by the label.

JLabel

public JLabel(Icon image,
              int horizontalAlignment)
Enabled: Creates a JLabel instance with the specified image and horizontal alignment. The label is centered vertically in its display area.

Parameters:
horizontalAlignment - One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.

JLabel

public JLabel(Icon image)
Enabled: Creates a JLabel instance with the specified image. The label is centered vertically and horizontally in its display area.


JLabel

public JLabel()
Enabled: Creates a JLabel instance 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.

Method Detail

getUI

public javax.swing.plaf.LabelUI getUI()
Suppressed: Returns the L&F object that renders this component.

Returns:
LabelUI object

setUI

public void setUI(javax.swing.plaf.LabelUI ui)
Suppressed: Sets the L&F object that renders this component.

Parameters:
ui - the LabelUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent)

updateUI

public void updateUI()
Suppressed: Resets the UI property to a value from the current look and feel.

Overrides:
updateUI in class JComponent
See Also:
JComponent.updateUI()

getUIClassID

public String getUIClassID()
Suppressed: Returns a string that specifies the name of the l&f class that renders this component.

Overrides:
getUIClassID in class JComponent
Returns:
String "LabelUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

getText

public String getText()
Enabled: Returns the text string that the label displays.

Returns:
a String
See Also:
setText(java.lang.String)

setText

public void setText(String text)
Enabled: 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.

This is a JavaBeans bound property.

See Also:
setVerticalTextPosition(int), setHorizontalTextPosition(int), setIcon(javax.swing.Icon)

getIcon

public Icon getIcon()
Enabled: Returns the graphic image (glyph, icon) that the label displays.

Returns:
an Icon
See Also:
setIcon(javax.swing.Icon)

setIcon

public void setIcon(Icon icon)
Enabled: Defines the icon this component will display. If the value of icon is null, nothing is displayed.

The default value of this property is null.

This is a JavaBeans bound property.

See Also:
setVerticalTextPosition(int), setHorizontalTextPosition(int), getIcon()

getDisabledIcon

public Icon getDisabledIcon()
Enabled: Returns the value of the disabledIcon property if it's been set, If it hasn't been set and the value of the icon property is an ImageIcon, we compute a "grayed out" version of the icon and update the disabledIcon property with that.

Returns:
The value of the disabledIcon property.
See Also:
setDisabledIcon(javax.swing.Icon), ImageIcon

setDisabledIcon

public void setDisabledIcon(Icon disabledIcon)
Enabled: Set the icon to be displayed if this JLabel is "disabled" (JLabel.setEnabled(false)).

The default value of this property is null.

Parameters:
disabledIcon - the Icon to display when the component is disabled
See Also:
getDisabledIcon(), JComponent.setEnabled(boolean)

setDisplayedMnemonic

public void setDisplayedMnemonic(int key)
Enabled: Specify a keycode that indicates a mnemonic key. This property is used when the label is part of a larger component. If the labelFor property of the label is not null, the label will call the requestFocus method of the component specified by the labelFor property when the mnemonic is activated.

See Also:
getLabelFor(), setLabelFor(java.awt.Component)

setDisplayedMnemonic

public void setDisplayedMnemonic(char aChar)
Enabled: Specifies the displayedMnemonic as a char value.

Parameters:
aChar - a char specifying the mnemonic to display
See Also:
setDisplayedMnemonic(int)

getDisplayedMnemonic

public int getDisplayedMnemonic()
Enabled: Return the keycode that indicates a mnemonic key. This property is used when the label is part of a larger component. If the labelFor property of the label is not null, the label will call the requestFocus method of the component specified by the labelFor property when the mnemonic is activated.

Returns:
int value for the mnemonic key
See Also:
getLabelFor(), setLabelFor(java.awt.Component)

setDisplayedMnemonicIndex

public void setDisplayedMnemonicIndex(int index)
                               throws IllegalArgumentException
Enabled: Provides a hint to the look and feel as to which character in the text should be decorated to represent the mnemonic. Not all look and feels may support this. A value of -1 indicates either there is no mnemonic, the mnemonic character is not contained in the string, or the developer does not wish the mnemonic to be displayed.

The value of this is updated as the properties relating to the mnemonic change (such as the mnemonic itself, the text...). You should only ever have to call this if you do not wish the default character to be underlined. For example, if the text was 'Save As', with a mnemonic of 'a', and you wanted the 'A' to be decorated, as 'Save As', you would have to invoke setDisplayedMnemonicIndex(5) after invoking setMnemonic(KeyEvent.VK_A).

Parameters:
index - Index into the String to underline
IllegalArgumentException
Since:
1.4

getDisplayedMnemonicIndex

public int getDisplayedMnemonicIndex()
Enabled: Returns the character, as an index, that the look and feel should provide decoration for as representing the mnemonic character.

Returns:
index representing mnemonic character
Since:
1.4
See Also:
setDisplayedMnemonicIndex(int)

checkHorizontalKey

protected int checkHorizontalKey(int key,
                                 String message)
Verify that key is a legal value for the horizontalAlignment properties.

Parameters:
key - the property value to check
message - the IllegalArgumentException detail message
See Also:
setHorizontalTextPosition(int), setHorizontalAlignment(int)

checkVerticalKey

protected int checkVerticalKey(int key,
                               String message)
Verify that key is a legal value for the verticalAlignment or verticalTextPosition properties.

Parameters:
key - the property value to check
message - the IllegalArgumentException detail message
See Also:
setVerticalAlignment(int), setVerticalTextPosition(int)

getIconTextGap

public int getIconTextGap()
Enabled: Returns the amount of space between the text and the icon displayed in this label.

Returns:
an int equal to the number of pixels between the text and the icon.
See Also:
setIconTextGap(int)

setIconTextGap

public void setIconTextGap(int iconTextGap)
Enabled: If both the icon and text properties are set, this property defines the space between them.

The default value of this property is 4 pixels.

This is a JavaBeans bound property.

See Also:
getIconTextGap()

getVerticalAlignment

public int getVerticalAlignment()
Enabled: Returns the alignment of the label's contents along the Y axis.

Returns:
The value of the verticalAlignment property, one of the following constants defined in SwingConstants: TOP, CENTER, or BOTTOM.
See Also:
SwingConstants, setVerticalAlignment(int)

setVerticalAlignment

public void setVerticalAlignment(int alignment)
Enabled: Sets the alignment of the label's contents along the Y axis.

The default value of this property is CENTER.

Parameters:
alignment - One of the following constants defined in SwingConstants: TOP, CENTER (the default), or BOTTOM.
See Also:
SwingConstants, getVerticalAlignment()

getHorizontalAlignment

public int getHorizontalAlignment()
Enabled: Returns the alignment of the label's contents along the X axis.

Returns:
The value of the horizontalAlignment property, one of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.
See Also:
setHorizontalAlignment(int), SwingConstants

setHorizontalAlignment

public void setHorizontalAlignment(int alignment)
Enabled: Sets the alignment of the label's contents along the X axis.

This is a JavaBeans bound property.

Parameters:
alignment - One of the following constants defined in SwingConstants: LEFT, CENTER (the default for image-only labels), RIGHT, LEADING (the default for text-only labels) or TRAILING.
See Also:
SwingConstants, getHorizontalAlignment()

getVerticalTextPosition

public int getVerticalTextPosition()
Enabled: Returns the vertical position of the label's text, relative to its image.

Returns:
One of the following constants defined in SwingConstants: TOP, CENTER, or BOTTOM.
See Also:
setVerticalTextPosition(int), SwingConstants

setVerticalTextPosition

public void setVerticalTextPosition(int textPosition)
Enabled: Sets the vertical position of the label's text, relative to its image.

The default value of this property is CENTER.

This is a JavaBeans bound property.

Parameters:
textPosition - One of the following constants defined in SwingConstants: TOP, CENTER (the default), or BOTTOM.
See Also:
SwingConstants, getVerticalTextPosition()

getHorizontalTextPosition

public int getHorizontalTextPosition()
Enabled: Returns the horizontal position of the label's text, relative to its image.

Returns:
One of the following constants defined in SwingConstants: LEFT, CENTER, RIGHT, LEADING or TRAILING.
See Also:
SwingConstants

setHorizontalTextPosition

public void setHorizontalTextPosition(int textPosition)
Enabled: Sets the horizontal position of the label's text, relative to its image.

See Also:
SwingConstants

imageUpdate

public boolean imageUpdate(Image img,
                           int infoflags,
                           int x,
                           int y,
                           int w,
                           int h)
Enabled: This is overridden to return false if the current Icon's Image is not equal to the passed in Image img.

Overrides:
imageUpdate in class Component
Parameters:
img - the image being observed
infoflags - see imageUpdate for more information
x - the x coordinate
y - the y coordinate
w - the width
h - the height
Returns:
false if the infoflags indicate that the image is completely loaded; true otherwise.
See Also:
java.awt.image.ImageObserver, java.awt.Component#imageUpdate(java.awt.Image, int, int, int, int, int)

writeObject

private void writeObject(ObjectOutputStream s)
                  throws IOException
See readObject() and writeObject() in JComponent for more information about serialization in Swing.

Parameters:
s - the ObjectOutputStream in which to write
IOException

paramString

protected String paramString()
Returns a string representation of this JLabel. This method is intended to be used only for debugging purposes, and the content and format of the returned string may vary between implementations. The returned string may be empty but may not be null.

Overrides:
paramString in class JComponent
Returns:
a string representation of this JLabel.

getLabelFor

public Component getLabelFor()
Enabled: Get the component this is labelling.

Returns:
the Component this is labelling. Can be null if this does not label a Component. If the displayedMnemonic property is set and the labelFor property is also set, the label will call the requestFocus method of the component specified by the labelFor property when the mnemonic is activated.
See Also:
getDisplayedMnemonic(), setDisplayedMnemonic(int)

setLabelFor

public void setLabelFor(Component c)
Enabled: Set the component this is labelling. Can be null if this does not label a Component. If the displayedMnemonic property is set and the labelFor property is also set, the label will call the requestFocus method of the component specified by the labelFor property when the mnemonic is activated.

Parameters:
c - the Component this label is for, or null if the label is not the label for a component
See Also:
getDisplayedMnemonic(), setDisplayedMnemonic(int)

getAccessibleContext

public AccessibleContext getAccessibleContext()
Suppressed: Get the AccessibleContext of this object

Specified by:
getAccessibleContext in interface Accessible
Overrides:
getAccessibleContext in class JComponent
Returns:
the AccessibleContext of this object


comments?