| Author |
getTransferdata() not working as expected in drag drop from jtable to jtree
|
Shabana Patel
Greenhorn
Joined: Dec 06, 2012
Posts: 1
|
|
Hi
I am trying to drag multiple rows (discontinuous ) from a jtable to a jtree. I am using a customized transferable object and a customized transferhandler. However,I lose my objects within the import data method, as it gets lost inside the java method getTransferData(DataFlavor df) within class DropTargetContext.java. The code is as follows:
The class cObject is serializable. The customized transfer handler is declared as an inner class within the panel that contains both tree and table.
The transferable object t has the objects in array list correctly but when I call t.getTransferData, the array list comes back the null objects. E.g. if three rows were chosen from the table, This calls getTransferData method in cObjectList which returns these objects in the arraylist correctly but when it reaches getTransferData in DropTargetContext.java the values nside the array list return as null even thought the list/ object itself still shows size =3.
The drop mode selected for the tree is:
treeObjectStructure.setTransferHandler(new ObjectTreeTransferHandler());
treeObjectStructure.setDropMode(DropMode.ON_OR_INSERT);
Can anyone help me figure out what I have done wrong? I posted this question on stack overflow as well but did not receive any good suggestions, so now I'm asking here.
link:
http://stackoverflow.com/questions/13730660/gettransferdata-in-transferhandler-not-working-as-expected-for-multiple-droppi
|
 |
Kemal Sokolovic
Bartender
Joined: Jun 19, 2010
Posts: 792
|
|
Please BeForthrightWhenCrossPostingToOtherSites (link).
Welcome to Ranch!
|
The quieter you are, the more you are able to hear.
|
 |
 |
|
|
subject: getTransferdata() not working as expected in drag drop from jtable to jtree
|
|
|