Class GHyperlinkComponent

All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible

public class GHyperlinkComponent extends JPanel
A component that acts like a label, but adds the ability to render HTML links with a client callback for when the link is activated. Links can be activated by mouse clicking or or by focusing the link and then pressing Enter or Space.

Users can make one simple text link by calling addLink(String, Callback). Alternatively, users can mix plain text and links by using both addText(String) and addLink(String, Callback).

See Also:
  • Constructor Details

    • GHyperlinkComponent

      public GHyperlinkComponent()
  • Method Details

    • addText

      public void addText(String text)
      Adds text to this widget that will be displayed as plain text.
      Parameters:
      text - the text
    • addLink

      public void addLink(String text, Callback linkActivatedCallback)
      Uses the given text to create a link the user can click.
      Parameters:
      text - the text
      linkActivatedCallback - the callback that will be called when the link is activated