Using Documents

Four Base Interfaces

  • Document
    • A Document is an abstract interface that is the model representation of any text component (even text fields) in Swing.
    • The Document contains the data.
  • Element
    • Documents are partitioned into elements which describe the structural pieces of the docuement.
    • Elements contain the structure.
  • AttributeSet
    • Every element has an associated AttributeSet which defines things like font, text style, etc. that are applied to the element.
  • Position
    • Positions provide the ability to track a location in the document as things are inserted and removed in front of it.


Editor Kits >>