Class Hyperlink

  • All Implemented Interfaces:
    Styleable, EventTarget, Skinnable

    public class Hyperlink
    extends ButtonBase

    An HTML like label which can be a graphic and/or text which responds to rollovers and clicks. When a hyperlink is clicked/pressed isVisited() becomes true. A Hyperlink behaves just like a Button. When a hyperlink is pressed and released a ActionEvent is sent, and your application can perform some action based on this event.

    Example:

    Hyperlink link = new Hyperlink("www.oracle.com");
    Since:
    JavaFX 2.0
    • Constructor Detail

      • Hyperlink

        public Hyperlink()
        Creates a hyperlink with no label.
      • Hyperlink

        public Hyperlink​(String text)
        Create a hyperlink with the specified text as its label.
        Parameters:
        text - A text string for its label.
      • Hyperlink

        public Hyperlink​(String text,
                         Node graphic)
        Create a hyperlink with the specified text and graphic as its label.
        Parameters:
        text - A text string for its label.
        graphic - A graphic for its label
    • Method Detail

      • setVisited

        public final void setVisited​(boolean value)
        Sets the value of the property visited.
        Property description:
        Indicates whether this link has already been "visited".
      • isVisited

        public final boolean isVisited()
        Gets the value of the property visited.
        Property description:
        Indicates whether this link has already been "visited".
      • getInitialCursor

        protected Cursor getInitialCursor()
        Returns the initial cursor state of this control, for use by the JavaFX CSS engine to correctly set its initial value. This method is overridden to use the HAND cursor initially.
        Overrides:
        getInitialCursor in class Node
        Returns:
        the initial cursor state for this Node.
        Since:
        9