Class Hyperlink

All Implemented Interfaces:
LayoutMeasurable, LayoutMeasurableMixin, HasAlignmentProperty, HasBackgroundProperty, HasBlendModeProperty, HasBorderProperty, HasClipProperty, HasEffectProperty, HasFontProperty, HasGraphicProperty, HasHeightProperty, HasImageUrlProperty, HasLayoutXProperty, HasLayoutYProperty, HasManagedProperty, HasMaxHeightProperty, HasMaxWidthProperty, HasMinHeightProperty, HasMinWidthProperty, HasMouseTransparentProperty, HasOnMouseClickedProperty, HasOpacityProperty, HasPaddingProperty, HasParentProperty, HasPrefHeightProperty, HasPrefWidthProperty, HasSnapToPixelProperty, HasTextAlignmentProperty, HasTextFillProperty, HasTextProperty, HasVisibleProperty, HasWidthProperty, Styleable, EventTarget, Skinnable, INode, PreferenceResizableNode

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
  • Property Details

  • Constructor Details

    • 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 Details

    • visitedProperty

      public final Property<Boolean> visitedProperty()
      Indicates whether this link has already been "visited".
      Returns:
      the visited property
      See Also:
    • setVisited

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

      public final boolean isVisited()
    • fire

      public void fire()
      Implemented to invoke the ActionEvent if one is defined. This function will also setVisited(boolean) to true.
      Specified by:
      fire in class ButtonBase
    • createDefaultSkin

      protected Skin<?> createDefaultSkin()
      Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).
      Overrides:
      createDefaultSkin in class Control
      Returns:
      new instance of default skin for this control. If null then the control will have no skin unless one is provided by css.