something like this pseudocode:
Code:
public void populateTree(File root, JTreeNode toPopulate)
File[] dirEntries = f.listFiles();
for(int i = 0; i< dirEntries.length; i++){
if(dirEntries[i].isDirectory())
toPopulate.add(dirEntries[i]);
}
make a tree with just "c:\" in it
upon click, call that method and pass in a file pointing to the tree node, and the tree node itself, and youll get on-the-fly population of the tree 
-
alternatively you can do ahead-of-fly population, and populate node with children before it is clicked on.
note that expanding C:\ would hence require that you populate ALL of c:\ child nodes with THEIR children.. slow
explorer does on the fly popuatlion: it draws a + next to every folder and if it finds out the node has no children it removes it. good idea.
Bookmarks