public interface DocumentListener extends EventListener
The default implementation of the Document interface (AbstractDocument) supports asynchronous mutations. If this feature is used (i.e. mutations are made from a thread other than the Swing event thread), the listeners will be notified via the mutating thread. This means that if asynchronous updates are made, the implementation of this interface must be threadsafe!
The DocumentEvent notification is based upon the JavaBeans event model. There is no guarantee about the order of delivery to listeners, and all listeners must be notified prior to making further mutations to the Document. This means implementations of the DocumentListener may not mutate the source of the event (i.e. the associated Document).
Document
,
StyledDocument
,
DocumentEvent
Modifier and Type | Method and Description |
---|---|
void |
changedUpdate(DocumentEvent e)
Gives notification that an attribute or set of attributes changed.
|
void |
insertUpdate(DocumentEvent e)
Gives notification that there was an insert into the document.
|
void |
removeUpdate(DocumentEvent e)
Gives notification that a portion of the document has been
removed.
|
void insertUpdate(DocumentEvent e)
e
- the document eventvoid removeUpdate(DocumentEvent e)
e
- the document eventvoid changedUpdate(DocumentEvent e)
e
- the document event 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, 2012, Oracle and/or its affiliates. All rights reserved.