Like other Swing components, a text component separates its data (known as the model) from its view of the data.A text component's model is known as a document and is an instance of a class that implements the Document interface. A document provides these services for a text component: Contains the text. A document stores the textual content in Element objects, which can represent any logical text structure, such as paragraphs, text runs that share styles, and so on. We do not cover Elements. However, The Swing Connection has at least one article on the subject. Provides support for editing the text through the remove and insertString methods. Notifies document listeners and undoable edit listeners of changes to the text. 
Manages Position objects, which track a particular location within the text even as the text is modified. Allows you to get information about the text, such as its length, and segments of the text as a string. The Swing text package contains a subinterface of Document, StyledDocument, that adds support for ing up the text with styles.
明白Document是什么了吗? text components use an EditorKit to create and manage actions. Besides managing a set of actions for a text component, an editor kit also knows how to read and write documents of a particular format.
其实三言两语在这里也只能说个大概,要真的理解,还是看一下文档吧。
我是从JAVA TUTORIAL 里参考的。