Java javax.swing.text Document fields, constructors, methods, implement or subclass

Example usage for Java javax.swing.text Document fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for javax.swing.text Document.

The text is from its open source code.

Field

StringStreamDescriptionProperty
The property name for the description of the stream used to initialize the document.
StringTitleProperty
The property name for the title of the document, if there is one.

Method

voidaddDocumentListener(DocumentListener listener)
Registers the given observer to begin receiving notifications when changes are made to the document.
voidaddUndoableEditListener(UndoableEditListener listener)
Registers the given observer to begin receiving notifications when undoable edits are made to the document.
PositioncreatePosition(int offs)
This method allows an application to mark a place in a sequence of character content.
ElementgetDefaultRootElement()
Returns the root element that views should be based upon, unless some other mechanism for assigning views to element structures is provided.
intgetLength()
Returns number of characters of content currently in the document.
ObjectgetProperty(Object key)
Gets the properties associated with the document.
PositiongetStartPosition()
Returns a position that represents the start of the document.
StringgetText(int offset, int length)
Fetches the text contained within the given portion of the document.
voidgetText(int offset, int length, Segment txt)
Fetches the text contained within the given portion of the document.
voidinsertString(int offset, String str, AttributeSet a)
Inserts a string of content.
voidputProperty(Object key, Object value)
Associates a property with the document.
voidremove(int offs, int len)
Removes a portion of the content of the document.
voidremoveDocumentListener(DocumentListener listener)
Unregisters the given observer from the notification list so it will no longer receive change updates.
voidremoveUndoableEditListener(UndoableEditListener listener)
Unregisters the given observer from the notification list so it will no longer receive updates.
voidrender(Runnable r)
Allows the model to be safely rendered in the presence of concurrency, if the model supports being updated asynchronously.