Re: problem related to transferhandler



On 27 Oct 2005 01:14:40 -0700, "Pravin"
<pravin.kadam@xxxxxxxxxxxxxxxxxxxxx> wrote, quoted or indirectly
quoted someone who said :

>If i am extending the TransferHandler how do i implement the
>export method for exporting the data of my class type?
>Eg:ElementWrapper exportElement(JComponent c);

Just what do you want to export and in what form?

Here are some possibilities:

1. a byteArray of the serialised JComponent. See
http://mindprod.com/applets/fileio.html
Watchout, serialisation of a since JComponent will drag everthing it
is connected to directly or indirectly.

2. a CSV string of the crucial fields of the JComponent including a
string identifing the JComponent class.
see http://mindprod.com/gloss/csv.html

3. Use reflection to crawl through your component looking for
interesting things to snapshot including additional fields.

4. An Object that simply has fields of the fields you want to persist
that you copy over.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Java custom programming, consulting and coaching.
.