开发者

Copy/paste from JTextPane to others application without text formatting support

I have a JTextPane with contentType set to "text/html". The content of the JTextPane is formatted with html. My lines are formatted like this: "<p>hello</p>\n".

I'm able to copy data from my JTextPane to an application that support text formatting like OpenOffice (I get my text with formatting like color and lines breaks), but when I try to paste my data to an application that doesn't support text formatting (like gedit), I lose my l开发者_开发技巧ines breaks (I get all the lines merged into one single line).

Any idea how to be able to correctly paste my text with lines breaks to application that doesn't support text formatting?

Thanks!


Forget it... I found that my html formatting was bad. It's working now with a correct formatting. I don't even need a \n after the &lt;p&gt; tags, swing convert it to line break automatically.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜