title: load RTF into JTextPane
body: <p>I created a class of type JTextPane in my text editor program. it has a subclass of text and richtext that inherts from my main JTextPaneClass. However, I'm unable to load RTF into my richtext because the method of reading fileinput stream isn't in the superclass JTextPane. So how do I read rich text into jtextpane? This seems very simple I must be missing something. I see lots of examples using RTFEditorKit and filling into the JTextPane but not when its instantiated as a class.</p>
  
  <pre><code>public class RichTextEditor extends TextEditorPane {
  
  private final String extension = ".rtf";
  private final String filetype = "text/richtext";
  
  public RichTextEditor() {
      // super( null, "", "Untitled", null );
      super();
      // this.setContentType( "text/richtext" );
  }
  
  /**
   * Constructor for tabs with content.
   * 
   * @param stream
   * @param path
   * @param fileName
   * @param color
   */
  public RichTextEditor( FileInputStream stream, String path, String fileName, Color color, boolean saveEligible ) {
      super( path, fileName, color, saveEligible );
      super.getScrollableTracksViewportWidth();
      //RTFEditorKit rtf = new RTFEditorKit();
      //this.setEditorKit( rtf );
      setEditor();
      this.read(stream, this.getDocument(), 0);
      //this.read( stream, "RTFEditorKit" );
      this.getDocument().putProperty( "file name", fileName );
  }
  
  
  
  private void setEditor() {
      this.setEditorKit( new RTFEditorKit() );
  
  }
  </code></pre>
  
  <p>the line:</p>
  
  <pre><code>this.read(stream, this.getDocument(), 0);
  </code></pre>
  
  <p>tells me</p>
  
  <blockquote>
    <p>The method read(InputStream, Document) in the type JEditorPane is not applicable for the arguments (FileInputStream, Document, int)</p>
  </blockquote>