Re: Cut & Paste in Swing



On 4/26/2005 at 9:31:34 AM, clemenr@xxxxxxxxxx wrote:

> 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.

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.

--
Regards,

John McGrath
.