This article explains how the Element interface works and shows how you can make use of it in your Swing programs. The article may help you get a better understanding of how Swing's Document interface models its content, as well as how operations on the Document interface affect the structure of its associated document. The interface Element is defined in javax.swing.text.Element file. In Swing, the interface Element defines a structural piece of a Document, like a paragraph, a line of text, or a list item in an HTML document. Every Element is either a branch or a leaf .
Branches can have any number of children.
Leaves do not have children.