• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

JTree DnD multiple node selections?

 
Ranch Hand
Posts: 131
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Solution is pretty simple

You just need to make Component ready for Drag&Drop

tree.setDargEnabled(true);
 
Listen. That's my theme music. That's how I know I'm a super hero. That, and this tiny ad told me:
Clean our rivers and oceans from home
https://www.kickstarter.com/projects/paulwheaton/willow-feeders
reply
    Bookmark Topic Watch Topic
  • New Topic