wood burning stoves 2.0*
The moose likes Swing / AWT / SWT and the fly likes JTree DnD multiple node selections? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree DnD multiple node selections?" Watch "JTree DnD multiple node selections?" New topic
Author

JTree DnD multiple node selections?

Ravi Sathish
Ranch Hand

Joined: Feb 26, 2002
Posts: 131
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

Joined: Feb 26, 2002
Posts: 131
Solution is pretty simple

You just need to make Component ready for Drag&Drop

tree.setDargEnabled(true);
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JTree DnD multiple node selections?
 
Similar Threads
Custom Multiple Selection for JTree
Does Jtree support Drag and Drop?
Drag and Drop from JList to JTree
JTree
JTree Selection Customization