Is there a way to output contents of a StyledDocument in HTML?
I need to save contents of StyledDocument, formatted with standard styles (e.g. bold, italic, various font sizes). And so there is my questio开发者_如何学Pythonn - is it possible to output it into HTML someway?
Found the answer. I just used HTMLEditorKit, got list of it's actions, and assigned actions to buttons. Then JTextPane.getText() returns the html-formatted string.
Yes you can use the 'write' method of 'HTMLEditorKit'
- http://download.oracle.com/javase/6/docs/api/javax/swing/text/html/HTMLEditorKit.html
The document gonna be write in HTML 3.2
精彩评论