HTML Text class

The HTMLText class allows you to access text properties for your HTML page. Using the HTMLText class, you can get, set and check the status of many text attributes, including:

The following example shows you how to create an HTMLText object and set its bold attribute on and its font size to 5.

    HTMLText text = new HTMLText("IBM");
    text.setBold(true);
    text.setSize(5);
    System.out.println(text.getTag());

The print statement produces the following tag:

     <font size="5"><b>IBM</b></font>

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

IBM®