• 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
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Subtree in JTree

 
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
JTree has root folder invisible. It has folders as child nodes of tree called A, B, C, D.

A, B can contain only leaf nodes.

C, D can contain child nodes as folder and those child folders will have leaf nodes.

The problem is I want C/D should be treated as single tree i.e. user can not move any leaf node of C/D tree to any other folder like A/B...that is 'p' can be moved to Folder2 but not to folder 'A'/ 'B'...How to make these type of settings??



Kindly help me.
[ July 02, 2008: Message edited by: Jeevan Anand ]
 
Ranch Hand
Posts: 1535
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried to keep this simple to show/emphasize how to customize the drop behavior. There are so many possibilities that it's difficult to say much about it.

Edit: Most of the code in the TransferHandler was taken from the Drag and Drop tutorial.
[ July 04, 2008: Message edited by: Craig Wood ]
 
You can't expect to wield supreme executive power just because
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic