• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JTree DnD multiple node selections?

 
Ravi Sathish
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greetings Ranchers,

I'm trying to implement Drag N Drop feature on my JTree.

So far:
I have got a crude version of my app running
I can drag and drop a tree_node from one place to another with in the tree.

However I cannot select mutliple nodes with current arrangement. The only way that I know to make multiple selections is using CTRL button. (Press Control and click on nodes to make selection.)

As soon as user tries to drag a group of selected nodes; the selections vanish and only selection remains.

Has anybody faced similar problems?
Any solutions/workarounds/suggestions to this problem?

TIA
Ravi
 
Ravi Sathish
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Solution is pretty simple

You just need to make Component ready for Drag&Drop

tree.setDargEnabled(true);
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic