views:

257

answers:

1

i was trying to do some simple text formatting using JEditorPane but then as knowledge grew i found JTextPane easier to implement and more robust.

my query is how do i save the formatted text in JTextPane to file? it should be RTF or HTML or other.. as this file is not opened by the application again.

it is a chat history text file with formatted text.

thank you.

+1  A: 

You have write method for HTML and RTF from StyledEditorKit. See HTMLEditorKit.write and RTFEditorKit

Istao
thanks it took really long this time around to understand the issue but glad it worked out. now have a working demo. :)
iEisenhower