By default, copy and paste of text from javax.swing.text.* components
seems to capture formatting.
Is there any way to turn this off within java, so that only the plain
text is copied, stripped of any formatting?
Why do I care? Pasting such java 1.4.2 formatted text crashes netscape
7.1 mail, and my app is such that the formatting really doesn't matter
outside of it.
If you have netscape 7.1 mail (winxp), you can reproduce this problem
by
1. start webstart app "The SwingSet Demo" at
http://java.sun.com/products/javawebstart/demos.html
2. go to "JEditorPane Html"
3. select some text
4. copy into a netscape mail message. It'll freeze.
Other apps (ms-word) accept the paste without problems.
I'm not sure if this is a swing bug or a netscape bug. It seems to me
like it's probably on the netscape side. But I suspect it might be
easier to work around on the java side, and copying unformatted text is
theoretically a generally useful thing.
Thanks!
Reinhard
Uwe Ziegenhagen - 21 Apr 2005 05:07 GMT
> By default, copy and paste of text from javax.swing.text.* components
> seems to capture formatting.
[quoted text clipped - 28 lines]
>
> Reinhard
I am not sure, but try a different data flavor on the stuff that you
copy. I think there is a flavor just for simple text.
Uwe

Signature
mail to newsgroup@ziegenhagen.info is read only from time to time. If
you need an urgent answer, google for me.