Java >
Guidelines Home Page >  Java Look and Feel Design Guidelines
>
Part III: The Components of the Java Foundation Classes
> 11: Text Components >
Editor Panes
  Previous Next Contents/Index/Search


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:

  • Default editor kit
  • Styled text editor kit
  • RTF editor kit
  • HTML editor kit

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.

Default 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.

Styled Text Editor Kit

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).

Figure 181   Styled Text Editor Kit

 

Styled Text Editor Kit

RTF Editor Kit

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

 

RTF Editor Kit

HTML 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

 

HTML Editor Kit


Java Look and Feel Design Guidelines, second edition.
Copyright 2001. Sun Microsystems, Inc. All Rights Reserved.
Previous Next Contents/Index/Search
Left Curve
Java SDKs and Tools
Right Curve
Left Curve
Java Resources
Right Curve
JavaOne Banner
Java 8 banner (182)