APIdia Launch Partner
Top Description Interfaces Classes
module java.desktop

Package javax.swing.text


Provides classes and interfaces that deal with editable and noneditable text components. Examples of text components are text fields and text areas, of which password fields and document editors are special instantiations. Features that are supported by this package include selection/highlighting, editing, style, and key mapping.

Note

Most of the Swing API is not thread safe. For details, see Concurrency in Swing, a section in The Java Tutorial.

Related Documentation

For overviews, tutorials, examples, guides, and tool documentation, please see:
Since
1.2

Interface Summary

Modifier and TypeInterface and Description
public interface
AttributeSet

A collection of unique attributes.

public interface
Caret

A place within a document view that represents where things can be inserted into the document model.

public interface
Document

The Document is a container for text that serves as the model for swing text components.

public interface
Element

Interface to describe a structural piece of a document.

public interface
Highlighter

An interface for an object that allows one to mark up the background with colored areas.

public interface
Keymap

A collection of bindings of KeyStrokes to actions.

public interface
MutableAttributeSet

A generic interface for a mutable collection of unique attributes.

public interface
Position

Represents a location within a document.

public interface
Style

A collection of attributes to associate with an element in a document.

public interface
StyledDocument

Interface for a generic styled document.

public interface
TabableView

Interface for Views that have size dependent upon tabs.

public interface
TabExpander

Simple interface to allow for different types of implementations of tab expansion.

public interface
ViewFactory

A factory to create a view of some portion of document subject.

Class Summary

Modifier and TypeClass and Description
public abstract class
AbstractDocument

An implementation of the document interface to serve as a basis for implementing various kinds of documents.

public abstract class
AbstractWriter

AbstractWriter is an abstract class that actually does the work of writing out the element tree including the attributes.

public class
AsyncBoxView

A box that does layout asynchronously.

public class
BadLocationException

This exception is to report bad locations within a document model (that is, attempts to reference a location that doesn't exist).

public class
BoxView

A view that arranges its children into a box shape by tiling its children along an axis.

public class
ChangedCharSetException

ChangedCharSetException as the name indicates is an exception thrown when the charset is changed.

public class
ComponentView

Component decorator that implements the view interface.

public abstract class
CompositeView

CompositeView is an abstract View implementation which manages one or more child views.

public class
DateFormatter

DateFormatter is an InternationalFormatter that does its formatting by way of an instance of java.text.DateFormat.

public class
DefaultCaret

A default implementation of Caret.

public class
DefaultEditorKit

This is the set of things needed by a text component to be a reasonably functioning editor for some type of text document.

public class
DefaultFormatter

DefaultFormatter formats arbitrary objects.

public class
DefaultFormatterFactory

An implementation of JFormattedTextField.AbstractFormatterFactory.

public class
DefaultHighlighter

Implements the Highlighter interfaces.

public class
DefaultStyledDocument

A document that can be marked up with character and paragraph styles in a manner similar to the Rich Text Format.

public abstract class
DefaultTextUI

Deprecated

This class has been deprecated and should no longer be used.

public class
DocumentFilter

DocumentFilter, as the name implies, is a filter for the Document mutation methods.

public abstract class
EditorKit

Establishes the set of things needed by a text component to be a reasonably functioning editor for some type of text content.

public class
ElementIterator

ElementIterator, as the name suggests, iterates over the Element tree.

public class
FieldView

Extends the multi-line plain text view to be suitable for a single-line editor view.

public abstract class
FlowView

A View that tries to flow it's children into some partially constrained space.

public class
GapContent

An implementation of the AbstractDocument.Content interface implemented using a gapped buffer similar to that used by emacs.

pack-priv abstract class
GapVector

An implementation of a gapped buffer similar to that used by emacs.

pack-priv class
GlyphPainter1

A class to perform rendering of the glyphs.

pack-priv class
GlyphPainter2

A class to perform rendering of the glyphs.

public class
GlyphView

A GlyphView is a styled chunk of text that represents a view mapped over an element in the text model.

public class
IconView

Icon decorator that implements the view interface.

public class
InternationalFormatter

InternationalFormatter extends DefaultFormatter, using an instance of java.text.Format to handle the conversion to a String, and the conversion from a String.

public abstract class
JTextComponent

JTextComponent is the base class for swing text components.

public class
LabelView

A LabelView is a styled chunk of text that represents a view mapped over an element in the text model.

public abstract class
LayeredHighlighter

Implementation of Highlighter interface to mark up the background of leaf views with colored areas.

public class
LayoutQueue

A queue of text layout tasks.

public class
MaskFormatter

MaskFormatter is used to format and edit strings.

public class
NavigationFilter

NavigationFilter can be used to restrict where the cursor can be positioned.

public class
NumberFormatter

NumberFormatter subclasses InternationalFormatter adding special behavior for numbers.

public class
ParagraphView

View of a simple line-wrapping paragraph that supports multiple fonts, colors, components, icons, etc. It is basically a vertical box with a margin around it.

public class
PasswordView

Implements a View suitable for use in JPasswordField UI implementations.

public class
PlainDocument

A plain document that maintains no character attributes.

public class
PlainView

Implements View interface for a simple multi-line text view that has text in one font and color.

public class
Segment

A segment of a character array representing a fragment of text.

pack-priv class
SegmentCache

SegmentCache caches Segments to avoid continually creating and destroying of Segments.

public class
SimpleAttributeSet

A straightforward implementation of MutableAttributeSet using a hash table.

pack-priv class
StateInvariantError

This exception is to report the failure of state invariant assertion that was made.

public class
StringContent

An implementation of the AbstractDocument.Content interface that is a brute force implementation that is useful for relatively small documents and/or debugging.

public class
StyleConstants

A collection of well known or common attribute keys and methods to apply to an AttributeSet or MutableAttributeSet to get/set the properties in a typesafe manner.

public class
StyleContext

A pool of styles and their associated resources.

public class
StyledEditorKit

This is the set of things needed by a text component to be a reasonably functioning editor for some type of text document.

public abstract class
TableView

Implements View interface for a table, that is composed of an element structure where the child elements of the element this view is responsible for represent rows and the child elements of the row elements are cells.

public class
TabSet

A TabSet is comprised of many TabStops.

public class
TabStop

This class encapsulates a single tab stop (basically as tab stops are thought of by RTF).

public abstract class
TextAction

An Action implementation useful for key bindings that are shared across a number of different text components.

pack-priv class
TextLayoutStrategy

A flow strategy that uses java.awt.font.LineBreakMeasurer to produce java.awt.font.TextLayout for i18n capable rendering.

public class
Utilities

A collection of methods to deal with various text related activities.

public abstract class
View

A very important part of the text package is the View class.

pack-priv class
WhitespaceBasedBreakIterator

A simple whitespace-based BreakIterator implementation.

public class
WrappedPlainView

View of plain text (text with only one font and color) that does line-wrapping.

public class
ZoneView

ZoneView is a View implementation that creates zones for which the child views are not created or stored until they are needed for display or model/view translations.