EventListener
JEditorPane.AccessibleJEditorPane
, JEditorPane.AccessibleJEditorPaneHTML
, JEditorPane.JEditorPaneAccessibleHypertextSupport
, JPasswordField.AccessibleJPasswordField
, JTextArea.AccessibleJTextArea
, JTextComponent.AccessibleJTextComponent
, JTextField.AccessibleJTextField
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).
Modifier and Type | Method | Description |
---|---|---|
void |
changedUpdate |
Gives notification that an attribute or set of attributes changed. |
void |
insertUpdate |
Gives notification that there was an insert into the document. |
void |
removeUpdate |
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
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.desktop/javax/swing/event/DocumentListener.html