Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / April 2005

Tip: Looking for answers? Try searching our database.

Copy and Paste Unformatted Text

Thread view: 
reinhard.engels@gmail.com - 20 Apr 2005 20:19 GMT
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.



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.