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.

Cut & Paste in Swing

Thread view: 
clemenr@wmin.ac.uk - 26 Apr 2005 14:31 GMT
Hi. I have an application with a JTable and a custom cell editor
object. I have cut and paste from the system clipboard working, but
only for unformatted strings.

My custom cell editor allows text formatting including bold, underline,
italic, and selection of fonts. I would like to be able to cut and
paste to/from different cells in the program, and to/from external
software such as editors.

As far as I can see, I can easily cut and paste formatted information
between cells in my program using a custom data flavour. However, this
wouldn't allow me to cut and paste formatted text to/from word
processors etc.

Thanks in anticipation,

Ross-c
John McGrath - 29 Apr 2005 02:26 GMT
> Hi. I have an application with a JTable and a custom cell editor
> object. I have cut and paste from the system clipboard working, but
[quoted text clipped - 4 lines]
> paste to/from different cells in the program, and to/from external
> software such as editors.

In order to exchange formatted text with other programs, you will need to
decide what data formats you want to support.  Many programs that support
formatted text will support HTML, so you might choose that.  The Java
DataTransfer mechanism should be able to convert the clipboard contents to
a String for you, or provide a Reader that you can use to get the contents.

Signature

Regards,

John McGrath



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.