javax.swing.text.rtf

Class RTFEditorKit

public class RTFEditorKit extends StyledEditorKit

Provides support for RTF data for use in {@link javax.swing.JEditorPane}s.
Constructor Summary
RTFEditorKit()
Constructs a new RTFEditorKit.
Method Summary
StringgetContentType()
Returns the MIME content type.
voidread(InputStream stream, Document doc, int pos)
Reads RTF data from stream into doc at the specified position pos.
voidread(Reader reader, Document doc, int pos)
Reads RTF data from reader into doc at the specified position pos.

Constructor Detail

RTFEditorKit

public RTFEditorKit()
Constructs a new RTFEditorKit.

Method Detail

getContentType

public String getContentType()
Returns the MIME content type. In the case of RTFEditorKit this is 'text/rtf'

Returns: the MIME content type for RTFEditorKit

read

public void read(InputStream stream, Document doc, int pos)
Reads RTF data from stream into doc at the specified position pos.

Parameters: stream the {@link InputStream} from where we read RTF data doc the {@link Document} into which we read the RTF data pos the position where to start

Throws: IOException if an IO error occurs BadLocationException if the position is not valid

read

public void read(Reader reader, Document doc, int pos)
Reads RTF data from reader into doc at the specified position pos.

Parameters: reader the {@link Reader} from where we read RTF data doc the {@link Document} into which we read the RTF data pos the position where to start

Throws: IOException if an IO error occurs BadLocationException if the position is not valid