Interface DocumentListener
- All Superinterfaces:
EventListener
- All Known Implementing Classes:
-
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).
- See Also:
Method Summary
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. |
Method Details
insertUpdate
void insertUpdate(DocumentEvent e)
- Parameters:
-
e
- the document event
removeUpdate
void removeUpdate(DocumentEvent e)
- Parameters:
-
e
- the document event
changedUpdate
void changedUpdate(DocumentEvent e)
- Parameters:
-
e
- the document event
© 1993, 2021, 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/17/docs/api/java.desktop/javax/swing/event/DocumentListener.html