java - How to search a node in outline view in swing -


i have implemented outline view in application consist of 200 node. how can search specific node , expand ?

i have looked breadthfirstenumeration() , depthfirstenumeration() method of defaultmutabletreenode not find equivalent method in outline.

the approach depends on treemodel used construct outlinemodel. in filetreemodel cited, getroot() returns arbitrary file representing root of subtree in hierarchical file system. subtree can searched recursively shown here. instead of printing results, accumulate file instances representing path array. array used construct treepath. given such treepath, can reveal corresponding node in manner analogous shown here.

outline.expandpath(treepath); outline.scrollrecttovisible(getpathbounds(treepath)); 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -