Class HyperLinkButton

All Implemented Interfaces:
ImageObserver, ItemSelectable, MenuContainer, Serializable, Accessible, SwingConstants

public class HyperLinkButton extends JButton
A custom Swing button that looks like a hyperlink.

The button displays a URL as underlined text and opens it in the default browser when clicked. It supports customizable tool tip text, horizontal padding, font name, and font size.

Example usage:

 HyperLinkButton linkButton = new HyperLinkButton(
     "https://everdro1d.github.io",
     "Click to visit everdro1d's website",
     SwingConstants.LEFT,
     "Tahoma",
     12
 );
 
See Also:
  • Constructor Details

    • HyperLinkButton

      public HyperLinkButton(String url, String toolTipText, int horizontalPadding, String fontName, int fontSize)
      Creates a new HyperLinkButton with the specified URL and tool tip text.
      Parameters:
      url - the url to open and show
      toolTipText - tool tip text to show
      horizontalPadding - use SwingConstants.LEFT or SwingConstants.RIGHT
      fontName - name of font ex: "Tahoma"
      fontSize - font size
  • Method Details