Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-4106147

JEditorPane can't read a RTF file

XMLWordPrintable

    • swing1.0fcs
    • x86
    • windows_95
    • Verified

      JEditorPane should read a RTF file as well as HTML file. However it's not reading a RTF file. I tried it with both swing-0.7 and swing-pre-0.1 and I got same exception below:

      java.lang.IllegalArgumentException:
              at com.sun.java.swing.JEditorPane.createEditorKitForContentType(JEditorP
      ane.java:301)
              at com.sun.java.swing.JEditorPane.getEditorKitForContentType(JEditorPane
      .java:264)
              at com.sun.java.swing.JEditorPane.setContentType(JEditorPane.java:213)
              at com.sun.java.swing.JEditorPane.setPage(JEditorPane.java:136)
              at com.sun.java.swing.JEditorPane.<init>(JEditorPane.java:68)
              at HtmlReader.<init>(HtmlReader.java:58)
              at HtmlReader.main(HtmlReader.java:83)

      With swing-0.7: I could see whole text with some junk characters even though I got above exception.

      With swing-pre-0.1: I couldn't see anything and I got above exception.

      I attached 2 files to reproduce: HtmlReader.java and test.rtf
      To reproduce,
      java HtmlReader test.rtf


      bae-chul.kim@Eng 1998-01-22

            tprinzing Tim Prinzing (Inactive)
            bkimsunw Bae-chul Kim (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: