This week's book giveaway is in the Design forum.
We're giving away four copies of Building Microservices and have Sam Newman on-line!
See this thread for details.
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 Building Microservices this week in the Design forum!
JavaRanch » Java Forums » Java » Swing / AWT / SWT
Bookmark "JTree DnD multiple node selections?" Watch "JTree DnD multiple node selections?" New topic

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?

Ravi Sathish
Ranch Hand

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

You just need to make Component ready for Drag&Drop

I agree. Here's the link:
subject: JTree DnD multiple node selections?
jQuery in Action, 3rd edition