Begin change

HTMLTreeElement class

The HTMLTreeElement class represents an hierarchical element within an HTMLTree or other HTMLTreeElements.

Many tree element attributes can be retrieved or updating using methods that are provided in the HTMLTreeElement class. Some of the actions you can do with these methods are:

The following example creates an HTMLTreeElement object and displays the tag:

       // Create an HTMLTree.
       HTMLTree tree = new HTMLTree();

       // Create parent HTMLTreeElement.
       HTMLTreeElement parentElement = new HTMLTreeElement();
       parentElement.setTextUrl(new HTMLHyperlink("http://myWebPage", "My Web Page"));
       

       // Create HTMLTreeElement Child.
       HTMLTreeElement childElement = new HTMLTreeElement();
       childElement.setTextUrl(new HTMLHyperlink("http://anotherWebPage", "Another Web Page"));
       parentElement.addElement(childElement);

       // Add the tree element to the tree.
       tree.addElement(parentElement);
       System.out.println(tree.getTag());

The getTag() method in the above example generates HTML tags that look like those displayed below. The example below is for display purposes only:

- My Web Page
 
- Another Web Page
End change