[EMAIL PROTECTED] (Bernhard Hoelcker) wrote:
> Hi,
> To load a RTF-document, I tried to use an JEditorPane and
> invoke the read(Reader,null) method of its superclass JTextPane.
>
> But there is allways an IOException: īRFT is an 8-Bit formatī.
>
> I tried to build the Reader with:
>
> InputStreamReader(new FileInputStream(fileName),encoding).
> I tried every BytetoChar-Adapter I could find in the classes.zip, but it
> donīt work (see example attached).
>
> Does the read method require a special second parameter?
> Canīt find any Documention about this parameter.
> Thank you for any help,
>
> Bernhard
use com.sun.java.swing.text.rtf.RTFEditorKit's method:
read(java.io.InputStream in, Document doc, int pos)
instead.
You'll have to create an appropriate document using
createDefaultDocument().
Steve.
---------------------------------------------------------------------
Steve Alexander Linguistics and MEL
[EMAIL PROTECTED] Lancaster University
------------------- Sun Certified Java Programmer -------------------