• Post Reply Bookmark Topic Watch Topic
  • New Topic

Save JTextPane as RTF File  RSS feed

 
Michaela Fricker
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I've got a problem with saving my JTextPane as an rtf file. I want to mark some text with different colors. What I do at the moment is to create these objects:

and then mark the text like this:

Last I save my text as a rtf file

and evrything works fine.
But if I want to change the background color instead of the foreground, it is shown well in the JTextArea but not saved in the rtf file.
What I'm doing wrong?
Has anybody an idea?
Thanks!!!
 
Nathan Pruett
Bartender
Posts: 4121
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What version of the JDK are you using? I know that there were a couple of things that didn't make it into RTF support originally (such as images, background color, and some alignment stuff)... though I don't remember hearing if this ever got fixed... you might want to search the bug database on Sun's site...
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!