Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

getTransferdata() not working as expected in drag drop from jtable to jtree

 
Shabana Patel
Greenhorn
Posts: 1
Java Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 825
5
Java Python Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please BeForthrightWhenCrossPostingToOtherSites (link).

Welcome to Ranch!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic