Java Swing tutorials.
A document is used by the swing text component for representation of its components. When document’s content changes, document events take place. A document listener is attached to the text of document of the component instead of the text component, itself.
Document events are demonstrated by the given example, at 2 text components. Document Listener