org.tbee.swing
Class JLabel

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JLabel
                  extended by org.tbee.swing.JLabel
All Implemented Interfaces:
DragGestureListener, DragSourceListener, ImageObserver, MenuContainer, Serializable, EventListener, Accessible, SwingConstants
Direct Known Subclasses:
ImageButton, JTextComponentPrompt

public class JLabel
extends JLabel
implements DragGestureListener, DragSourceListener

A class for passing more visual data to a JLabel in the constructor.

Version:
$Revision: 1.18 $
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JLabel
JLabel.AccessibleJLabel
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes/interfaces inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes/interfaces inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
static String PROPERTY_TEXT
           
static String PROPERTY_VISIBLE
           
static String SOURCECODE_VERSION
          Standard variable for determining version of a class file.
 
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.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
JLabel()
           
JLabel(Icon icon)
           
JLabel(JLabel jlabel)
           
JLabel(String text)
           
JLabel(String text, Color foregroundColor)
           
JLabel(String text, Color foregroundColor, Color backgroundColor)
           
JLabel(String text, Color foregroundColor, Font font)
           
JLabel(String text, Color foregroundColor, Font font, Color backgroundColor)
           
JLabel(String text, Font font)
           
JLabel(String text, Icon icon, int horizontalAlignment, Color foregroundColor)
           
JLabel(String text, int horizontalAlignment, Color foregroundColor)
           
 
Method Summary
 void dragDropEnd(DragSourceDropEvent evt)
          Called when the user finishes or cancels the drag operation.
 void dragEnter(DragSourceDragEvent evt)
          Called when the user is dragging this drag source and enters the drop target.
 void dragExit(DragSourceEvent evt)
          Called when the user is dragging this drag source and leaves the drop target.
 void dragGestureRecognized(DragGestureEvent evt)
          A drag initiating gesture is recognized
 void dragOver(DragSourceDragEvent evt)
          Called when the user is dragging this drag source and moves over the drop target.
 void dropActionChanged(DragSourceDragEvent evt)
          Called when the user changes the drag action between copy or move.
protected  int getDNDAction()
          Get the DND action, JLabel does per default copy
protected  Transferable getTransferable()
          Get the transferable
 boolean isDragEnabled()
           
 void setDragEnabled(boolean value)
           
 void setText(String v)
          Add PCE event
 void setVisible(boolean v)
          Add PCE event
 JLabel withFont(Font value)
           
 JLabel withText(String value)
           
 JLabel withVisible(boolean value)
           
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SOURCECODE_VERSION

public static final String SOURCECODE_VERSION
Standard variable for determining version of a class file.

See Also:
Constant Field Values

PROPERTY_VISIBLE

public static final String PROPERTY_VISIBLE
See Also:
Constant Field Values

PROPERTY_TEXT

public static final String PROPERTY_TEXT
See Also:
Constant Field Values
Constructor Detail

JLabel

public JLabel()
Parameters:
text -

JLabel

public JLabel(String text)
Parameters:
text -

JLabel

public JLabel(Icon icon)
Parameters:
text -

JLabel

public JLabel(String text,
              Color foregroundColor)
Parameters:
text -

JLabel

public JLabel(String text,
              Font font)
Parameters:
text -

JLabel

public JLabel(String text,
              Color foregroundColor,
              Font font)
Parameters:
text -

JLabel

public JLabel(String text,
              Color foregroundColor,
              Color backgroundColor)
Parameters:
text -

JLabel

public JLabel(String text,
              Color foregroundColor,
              Font font,
              Color backgroundColor)
Parameters:
text -

JLabel

public JLabel(String text,
              int horizontalAlignment,
              Color foregroundColor)
Parameters:
text -
horizontalAlignment -

JLabel

public JLabel(String text,
              Icon icon,
              int horizontalAlignment,
              Color foregroundColor)
Parameters:
text -
icon -
horizontalAlignment -

JLabel

public JLabel(JLabel jlabel)
Parameters:
text -
Method Detail

setVisible

public void setVisible(boolean v)
Add PCE event

Overrides:
setVisible in class JComponent

setText

public void setText(String v)
Add PCE event

Overrides:
setText in class JLabel

withFont

public JLabel withFont(Font value)

withVisible

public JLabel withVisible(boolean value)

withText

public JLabel withText(String value)

setDragEnabled

public void setDragEnabled(boolean value)

isDragEnabled

public boolean isDragEnabled()

getDNDAction

protected int getDNDAction()
Get the DND action, JLabel does per default copy

Returns:

getTransferable

protected Transferable getTransferable()
Get the transferable

Returns:

dragGestureRecognized

public void dragGestureRecognized(DragGestureEvent evt)
A drag initiating gesture is recognized

Specified by:
dragGestureRecognized in interface DragGestureListener

dragEnter

public void dragEnter(DragSourceDragEvent evt)
Called when the user is dragging this drag source and enters the drop target.

Specified by:
dragEnter in interface DragSourceListener

dragOver

public void dragOver(DragSourceDragEvent evt)
Called when the user is dragging this drag source and moves over the drop target.

Specified by:
dragOver in interface DragSourceListener

dragExit

public void dragExit(DragSourceEvent evt)
Called when the user is dragging this drag source and leaves the drop target.

Specified by:
dragExit in interface DragSourceListener

dropActionChanged

public void dropActionChanged(DragSourceDragEvent evt)
Called when the user changes the drag action between copy or move.

Specified by:
dropActionChanged in interface DragSourceListener

dragDropEnd

public void dragDropEnd(DragSourceDropEvent evt)
Called when the user finishes or cancels the drag operation.

Specified by:
dragDropEnd in interface DragSourceListener


Copyright © 2011 KnowledgePlaza. All Rights Reserved.