• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

make certain JTree nodes uneditable

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello,


PART 1:

i am using the classes found on this webpage

http://java.sun.com/products/jfc/tsc/articles/jtree/

i want a user to be able to modify any folder on his/her system except for system dependant folders such as WINDOWS and Documents And Settings. I think Windows will not allow this anyway, but I still would like these and maybe other nodes to not be editable.

I used


but this obviously makes everything editable.

PART 2:

in the JTree that display the user's file system there is a folder shown called "System Volume Information". when the node for this folder is clicked there is a noticable slowdown in performance of the software and the node does not expand. this for me is a useless node (useful for the user's system) to have in the JTree so I would like for it not to display at all.
i have tried to play around with the following code from the AbstractTreeModel class i have extended, but I am not sure this is where i should make the changes




everyone willing to share in there knowledge of these two items will be promised eternal paradise and a haraam of virgins - thanks
 
Hang a left on main. Then read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic