• Post Reply Bookmark Topic Watch Topic
  • New Topic

disable node of jtree  RSS feed

 
aminur rashid
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how can we disable a node of JTree
 
aminur rashid
Ranch Hand
Posts: 79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
did it like this way

in the

method of TreeSelectionListener impelentation get the
TreePath tp = event.getPath();
from TreePath get the component and then remove the selection from the treePath if it is the node u were checking/root node in this case
tree.getSelectionModel().removeSelectionPath(tp);
any other idea?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!