This simple package defines an RTFEditorKit that enables the javax.swing.JEditorPane component to display and edit Rich Text Format (RTF) documents. Figure 33-1 shows the class hierarchy of this package.

| RTFEditorKit | Java 1.2 | |
|
|
||
| javax.swing.text.rtf | cloneable serializable | |
This EditorKit subclass provides support to a JEditorPane component for displaying and editing text stored in Microsoft's Rich Text Format (RTF). The getContentType() method returns "text/rtf". The read() and write() methods know how to translate between the RTF file format and the Element tree structure of a DefaultStyledDocument.
| public class RTFEditorKit extends StyledEditorKit { | ||
| // | Public Constructors | |
| public RTFEditorKit (); | ||
| // | Public Methods Overriding StyledEditorKit | |
| public Object clone (); | ||
| // | Public Methods Overriding DefaultEditorKit | |
| public String getContentType (); | default:"text/rtf" | |
| public void read (java.io.Reader in, Document doc, int pos) throws java.io.IOException, BadLocationException; | ||
| public void read (java.io.InputStream in, Document doc, int pos) throws java.io.IOException, BadLocationException; | ||
| public void write (java.io.Writer out, Document doc, int pos, int len) throws java.io.IOException, BadLocationException; | ||
| public void write (java.io.OutputStream out, Document doc, int pos, int len) throws java.io.IOException, BadLocationException; | ||
| } | ||
Hierarchy: Object-->EditorKit(Cloneable,Serializable)-->DefaultEditorKit-->StyledEditorKit-->RTFEditorKit

Copyright © 2001 O'Reilly & Associates. All rights reserved.