The HTMLHeading class represents an HTML heading. Each heading can have its own alignment and level from 1 (largest font, most importance) to 6.
Methods for the HTMLHeading class include:
The following example creates three HTMLHeading objects:
// Create and display three HTMLHeading objects. HTMLHeading h1 = new HTMLHeading(1, "Heading", HTMLConstants.LEFT); HTMLHeading h2 = new HTMLHeading(2, "Subheading", HTMLConstants.CENTER); HTMLHeading h3 = new HTMLHeading(3, "Item", HTMLConstants.RIGHT); System.out.print(h1 + "\r\n" + h2 + "\r\n" + h3);
The previous example produces the following tags:
<h1 align="left">Heading</h1> <h2 align="center">Subheading</h2> <h3 align="right">Item</h3>