## Uses of Class
javax.swing.text.html.HTMLDocument

- Packages that use HTMLDocument
  Package | Description
  --- | ---
  javax.swing.text.html | Provides the class `HTMLEditorKit` and supporting classes for creating HTML text editors.

- - ### Uses of HTMLDocument in javax.swing.text.html

    Methods in javax.swing.text.html that return HTMLDocument
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected HTMLDocument` | HTMLEditorKit.HTMLTextAction.`getHTMLDocument(JEditorPane e)`

    Methods in javax.swing.text.html with parameters of type HTMLDocument
    Modifier and Type | Method | Description
    --- | --- | ---
    `protected int` | HTMLEditorKit.HTMLTextAction.`elementCountToTag(HTMLDocument doc, int offset, HTML.Tag tag)` Returns number of elements, starting at the deepest leaf, needed to get to an element representing `tag`.
    `protected Element` | HTMLEditorKit.HTMLTextAction.`findElementMatchingTag(HTMLDocument doc, int offset, HTML.Tag tag)` Returns the deepest element at `offset` matching `tag`.
    `protected Element[]` | HTMLEditorKit.HTMLTextAction.`getElementsAt(HTMLDocument doc, int offset)` Returns an array of the Elements that contain `offset`.
    `protected void` | HTMLEditorKit.InsertHTMLTextAction.`insertAtBoundary(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)` This is invoked when inserting at a boundary.
    `protected void` | HTMLEditorKit.InsertHTMLTextAction.`insertAtBoundry(JEditorPane editor, HTMLDocument doc, int offset, Element insertElement, String html, HTML.Tag parentTag, HTML.Tag addTag)` Deprecated. As of Java 2 platform v1.3, use insertAtBoundary
    `void` | HTMLEditorKit.`insertHTML(HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag insertTag)` Inserts HTML into an existing document.
    `protected void` | HTMLEditorKit.InsertHTMLTextAction.`insertHTML(JEditorPane editor, HTMLDocument doc, int offset, String html, int popDepth, int pushDepth, HTML.Tag addTag)` A cover for HTMLEditorKit.insertHTML.

    Constructors in javax.swing.text.html with parameters of type HTMLDocument
    Constructor | Description
    --- | ---
    `HTMLWriter(Writer w, HTMLDocument doc)` Creates a new HTMLWriter.
    `HTMLWriter(Writer w, HTMLDocument doc, int pos, int len)` Creates a new HTMLWriter.

Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2026, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.