Skip to content
Advertisement

Using Tree View in Java to implement a view of a filesystem with hierarchy

I’d like to create a tree view that displays a mod folder (the root directory) and the mods inside, but not the mod folders contents. Right now I can only get it to display all of the mod levels but I think its my method BuildChildren(). Any help would be appreciated.

I’ve included the code below.

JavaScript

Any help would be greatly appreciated. I think its the buildChildren method for sure, as that for each loop is just sort of building as it goes. I don’t know what would be a better way to do this though. Cheers.

Advertisement

Answer

I have done it this way. You may modify it according to your needs:

JavaScript
User contributions licensed under: CC BY-SA
5 People found this is helpful
Advertisement