Class Link

All Implemented Interfaces:
ActionListener, MouseListener, ImageObserver, ItemSelectable, MenuContainer, Serializable, EventListener, Accessible, SwingConstants

public class Link extends JButton implements MouseListener, ActionListener
A button that simulates a selectable URL link. The text is blue and underlined, and selecting the link generates an ActionEvent to registered listeners. Though this is a JButton it currently does not support rendering an icon along with text. The setLinkColor() method allows you to render the link in a different color.
Author:
kapono
See Also:
  • Field Details

    • linkColor

      protected Color linkColor
    • bg

      protected Color bg
    • INSETS

      protected static final Insets INSETS
    • LINE_OFFSET

      protected static final int LINE_OFFSET
      See Also:
    • DISABLED_SHADOW_OFFSET

      protected static final int DISABLED_SHADOW_OFFSET
      See Also:
  • Constructor Details

    • Link

      public Link()
      Creates a Link component; the text is blue and underlined like a URL link in a web browser.
    • Link

      public Link(String s)
      Creates a Link component; the text is blue and underlined like a URL link in a web browser.
      Parameters:
      s - The link text
    • Link

      public Link(String linkText, String helpText)
      This constructor creates a normal Link widget, but selecting the link displays a popup window containing a short help message.
      Parameters:
      linkText - The link text
      helpText - The message to display in the local help popup window
  • Method Details