Contents

Swinging Duke
Feedback Button
Left ArrowRight Arrow

 

The JTextComponent

A Lightweight Text-Editing Component

 

The support of text in AWT prior to Swing was quite limited; basically, text support was a thin interface mapped over the plain-text support provided by the native platform. This design provided the benefit of internationalization support that was offered by the native system, but it failed to meet the needs of many developers. When developers take it upon themselves to create their own support, they often leave out such features as support for internationalization, and they can then have a difficult time upgrading their code to take advantage of such features as Java 2D support. In Swing, the JTextComponent class is designed to provide a 100% pure Java text solution that fills in the gaps left by the text support provided in the previous API.


Goals

These are some of the goals that are aimed for in the Swing implementation of the JTextComponent class:


Incompatibilities with java.awt.TextComponent

TextEvent and TextListener have been replaced by the DocumentEvent and DocumentListener interfaces. The DocumentEvent interface provides substantially more information about the nature of the change, so that observers can efficiently update themselves to reflect the change.


The JTextComponent API

The JTextComponent API is generated by JavaDoc. It contains the bulk of the specification.

Arrows


Version 0.5. Last modified 09/04/97.
Copyright © 1995-97 Sun Microsystems, Inc. All Rights Reserved.

Sun's Home Page