0

I noticed in the following code

DefaultTreeModel treemodel = new DefaultTreeModel();
TreeNode root = treeModel.getRoot();

The problems is that root value is "root" not the path to the file on the file system.

What I would expect is something like "C:\" or "D:\" depending on the tree.

Any one run into this problem?

mKorbel
  • 109,525
  • 20
  • 134
  • 319
tuck
  • 452
  • 5
  • 15

1 Answers1

2

Is not exactly what are you asking, but here is an tutorial/example of how to implement a file tree.

http://www.chka.de/swing/tree/FileTreeModel.html

joze
  • 66
  • 5
  • For comparison, another `FileTreeModel` is cited [here](http://codereview.stackexchange.com/a/4447/6692). – trashgod Dec 21 '12 at 01:47