Java Platform 1.2

javax.swing.event
Interface DocumentEvent

All Known Implementing Classes:
AbstractDocument.DefaultDocumentEvent

public abstract interface DocumentEvent

Interface for document change notifications.


Inner Class Summary
static interface DocumentEvent.ElementChange
          Describes changes made to an element.
static class DocumentEvent.EventType
          Typesafe enumeration for document event types
 
Method Summary
 DocumentEvent.ElementChange getChange(Element elem)
          Gets the change information for the given element.
 Document getDocument()
          Gets the document that sourced the change event.
 int getLength()
          Returns the length of the change.
 int getOffset()
          Returns the offset within the document of the start of the change.
 DocumentEvent.EventType getType()
          Gets the type of event.
 

Method Detail

getOffset

public int getOffset()
Returns the offset within the document of the start of the change.
Returns:
the offset >= 0

getLength

public int getLength()
Returns the length of the change.
Returns:
the length >= 0

getDocument

public Document getDocument()
Gets the document that sourced the change event.

getType

public DocumentEvent.EventType getType()
Gets the type of event.
Returns:
the type

getChange

public DocumentEvent.ElementChange getChange(Element elem)
Gets the change information for the given element. The change information describes what elements were added and removed and the location. If there were no changes, null is returned.
Parameters:
elem - the element
Returns:
the change information, or null if the element was not modified

Java Platform 1.2

Submit a bug or feature Version 1.2 of Java Platform API Specification
Java is a trademark or registered trademark of Sun Microsystems, Inc. in the US and other countries.
Copyright 1993-1998 Sun Microsystems, Inc. 901 San Antonio Road,
Palo Alto, California, 94303, U.S.A. All Rights Reserved.