| java.sun.com > Guidelines Home Page > Java Look and Feel Design Guidelines > Part III: The Components of the Java Foundation Classes > 11: Text Components > Editor Panes |
An editor pane is a multiline text pane that uses a plug-in editor kit to display a specific type of text, such as RTF (rich text format) or HTML (Hypertext Markup Language). An editor kit is capable of displaying all fonts included with the AWT. The JFC provides four kits that you can plug into an editor pane:
You can also create your own editor kit or use a third-party editor kit. For an example of how to create an editor kit, see Java Swing, described in Java.
The
setEditable method can be used to turn text editing on or off in an
editor kit.
You can use the default editor kit to edit and display text in a single font, size, and style. This kit is functionally equivalent to a text area.
You can embed images and components (such as tables) in a styled text editor kit.
You can use a styled text editor kit to edit and display multiple fonts, sizes, and styles, as shown in Figure 181.
Click here to view the corresponding code for Figure 181 (also available on the book's companion CD-ROM).
You can use an RTF editor kit to read, write, and display RTF text, as shown in the following figure. The RTF editor kit offers all the capabilities provided by the styled editor kit, and more.
Figure 182 RTF Editor Kit
You can use an HTML editor kit to display text in HTML 3.2. Users can click a link on the HTML page to generate an event, which you can use to replace the contents in the pane.
Figure 183 HTML Editor Kit
| Java Look and Feel Design Guidelines, second edition.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved. |