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

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

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -