swing - Java: How to select all descendants of a given ancestor on the Jtree? -



swing - Java: How to select all descendants of a given ancestor on the Jtree? -

i select ancestor defaultmutabletreenode , descendant defaultmutabletreenode of ancestor in jtree.

i using treeselectionlistener grab selection event on current jtree.

basically, able is, select ancestor node, , able re-create it's descendant tree ancestor.

you should able walk subtree recursively through children() of dmtn.

fwiw:

maybe help little, exampledepot site java illustration code, , have lot of swing examples.

here link set of jtree examples. hope find need.

http://www.exampledepot.com/egs/javax.swing.tree/pkg.html

java swing jtree

Comments

Popular posts from this blog

c# - Move local mssql database to webhosted MYSQL -

string - what is the difference between "some" == "some\0" and strcmp("some","some\0") in c++? -

java - How to pass parameters between Request-Scoped Controllers? -