0

I am using JTree to build folder tree structure(GUI), I can build it manually if I know proper file structure. I want to implement this structure reading structure specified in text file, which is dynamic. I am bit poor in coding recursion type problems. Please help me

If in text file structure is as shown below

label - level

root - 0 LivingBeings - 1 animals - 2 dog - 3 cat - 3 birds - 2 peacock - 3 crow - 3

I need a tree structure like as shown in imageenter image description here

1 Answer 1

1

You should consider implementing the TreeModel interface. As an example, FileTreeModel, cited here, works with either JTree, as shown here, or Outline, as shown here.

See also XMLTree, which reads nodes from an XML file, cited here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.