|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.awt.Component
java.awt.Label
edu.iastate.utils.gui.HyperlinkedLabel
A HyperlinkedLabel object is a component for placing a hyperlink into a container. A HyperlinkedLabel displays a single line of read-only text, which is underlined to give the visual impression of a hyperlink. Clicking on the hyperlink will produce no result however. It is up to the application developer to provide this functionality, such as performing an action, displaying a web page, or activating a menu.
Applications can catch hyperlink clicks by adding registering
an ActionListener, using the addActionListener method.
ActionEvent,
ActionListener,
Serialized Form| Nested Class Summary |
| Nested classes inherited from class java.awt.Label |
java.awt.Label.AccessibleAWTLabel |
| Nested classes inherited from class java.awt.Component |
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
(package private) java.awt.event.ActionListener |
actionListener
|
(package private) boolean |
clicked
|
private java.awt.Color |
hyperlinkColor
|
private java.awt.Color |
originalTextColor
|
private java.lang.String |
URL
|
| Fields inherited from class java.awt.Label |
CENTER, LEFT, RIGHT |
| 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 | |
HyperlinkedLabel(java.lang.String label)
Creates a hyperlinked label with no specific hyperlink |
|
HyperlinkedLabel(java.lang.String label,
java.lang.String URL)
Creates a hyperlinked label hyperlinked to the specified URL. |
|
HyperlinkedLabel(java.lang.String label,
java.lang.String URL,
java.awt.Color color)
Creates a hyperlinked label hyperlinked to the specified URL, in the specific color. |
|
| Method Summary | |
void |
addActionListener(java.awt.event.ActionListener listener)
Adds the specified action listener to receive action events from this hyperlink. |
java.awt.Color |
getHyperlinkColor()
Returns the color for this hyperlink. |
java.awt.Dimension |
getPreferredSize()
Returns the preferred size of the hyperlink. |
java.lang.String |
getURL()
Returns the URL for this hyperlink. |
void |
mouseClicked(java.awt.event.MouseEvent e)
|
void |
mouseEntered(java.awt.event.MouseEvent e)
Event handler for when the cursor enters the hyperlink |
void |
mouseExited(java.awt.event.MouseEvent e)
Event handler for when the cursor leaves the hyperlink |
void |
mousePressed(java.awt.event.MouseEvent e)
|
void |
mouseReleased(java.awt.event.MouseEvent e)
|
void |
paint(java.awt.Graphics g)
Paints the hyperlink |
void |
removeActionListener(java.awt.event.ActionListener listener)
Removes the specified action listener from the list of action listeners associated with this hyperlink. |
void |
setHyperlinkColor(java.awt.Color color)
Sets the color for this hyperlink. |
void |
setURL(java.lang.String URL)
Sets the URL destination for this hyperlink. |
| Methods inherited from class java.awt.Label |
addNotify, getAccessibleContext, getAlignment, getText, paramString, setAlignment, setText |
| Methods inherited from class java.awt.Component |
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, update, validate |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
private java.lang.String URL
private java.awt.Color hyperlinkColor
private java.awt.Color originalTextColor
transient boolean clicked
transient java.awt.event.ActionListener actionListener
| Constructor Detail |
public HyperlinkedLabel(java.lang.String label)
label - Text of label
public HyperlinkedLabel(java.lang.String label,
java.lang.String URL)
label - Text of labelURL - Universal Resource Locator (URL)
public HyperlinkedLabel(java.lang.String label,
java.lang.String URL,
java.awt.Color color)
label - Text of labelURL - Universal Resource Locator (URL)color - Color of hyperlink| Method Detail |
public void setURL(java.lang.String URL)
URL - Universal Resource Locator (URL)public void setHyperlinkColor(java.awt.Color color)
color - Color of hyperlinkpublic java.awt.Color getHyperlinkColor()
public java.lang.String getURL()
public void paint(java.awt.Graphics g)
g - Graphics object for paintingpublic void addActionListener(java.awt.event.ActionListener listener)
listener - ActionListener to add to event queuepublic void removeActionListener(java.awt.event.ActionListener listener)
listener - ActionListener to add to event queuepublic void mouseClicked(java.awt.event.MouseEvent e)
mouseClicked in interface java.awt.event.MouseListenerpublic void mouseEntered(java.awt.event.MouseEvent e)
mouseEntered in interface java.awt.event.MouseListenerpublic void mouseExited(java.awt.event.MouseEvent e)
mouseExited in interface java.awt.event.MouseListenerpublic void mousePressed(java.awt.event.MouseEvent e)
mousePressed in interface java.awt.event.MouseListenerpublic void mouseReleased(java.awt.event.MouseEvent e)
mouseReleased in interface java.awt.event.MouseListenerpublic java.awt.Dimension getPreferredSize()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||