Hi, this being a week later, you may not still be stuck. If so, here goes. Disclaimer: I have not used TreeView.
You write, "I am stuck (at the comment in my code). In original code, the method basically calls itself for every new file. But I can't do that with class, cant call that class within the same class."
I am thinking you could just, instead of making "TreeItem" objects, there, make FSTreeItem objects.
If you were to do that, then whenever one of those FSTreeItem children is seen (resulting from the call to "getChildren()" by client code), it will in turn have its "getChildren()" method. When called, it will lazily go out and 'look at' the filesystem to get those children.
Sorry if I have misunderstood what you were trying to do.