Win a copy of The Way of the Web Tester: A Beginner's Guide to Automating Tests this week in the Testing forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Saving and Restoring JEditorPane

Rudolf Meerkotter
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

I'd like to save the content from my JEditorPane (in text/rtf format) as a file with formatting in tact, and open again and set the contents of the JEditorPane with what's retrieved from the file. E.g. if something was made bold, it should still be bold if the file is opened...

With text/plain format this is easy. Normal character IO combined with getText and setText. I've searched and found that JEditorPane has a write(Writer) method, but can't find any explanations for it.

Can anyone point me in the right direction please?

  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic