HTMLHyperlink class

The HTMLHyperlink class represents an HTML hyperlink tag. You use the HTMLHyperlink class to create a link within your HTML page. You can get and set many attributes of hyperlinks with this class, including: The HTMLHyperlink class can print the full hyperlink with defined properties so that you can use the output in your HTML page.

The following is an example for HTMLHyperlink:

// Create an HTML hyperlink to the IBM Toolbox for Java home page.
HTMLHyperlink toolbox = new HTMLHyperlink("http://www.ibm.com/as400/toolbox", "IBM Toolbox for Java home page");

// Display the toolbox link tag.
System.out.println(toolbox.toString());

The code above produces the following tag:
<a href="http://www.ibm.com/as400/toolbox">IBM Toolbox for Java home page</a>

When you use this tag in an HTML page, it looks like this:

IBM Toolbox for Java home page