开发者

Java JTextPane Save

开发者 https://www.devze.com 2022-12-28 21:34 出处:网络
i was trying to do some simple text fo开发者_运维技巧rmatting using JEditorPane but then as knowledge grew i found JTextPane easier to implement and more robust.

i was trying to do some simple text fo开发者_运维技巧rmatting 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.


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

0

精彩评论

暂无评论...
验证码 换一张
取 消