Mathijs Alexander
Mathijs Alexander

Reputation: 17

Java File Tree Error (FileTreeModel cannot be resolved to a type)

I've used a piece of code from this question (Java JTree directory structure from file paths). But when I use it, I get an error: 'FileTreeModel cannot be resolved to a type'. I use eclipse, and have the last SDK. Anyone knows how to fix it?

Mathijs

TreeModel model = new FileTreeModel(new File(System.getProperty("user.dir")));
JTree tree = new JTree(model);

Upvotes: 0

Views: 639

Answers (1)

Reimeus
Reimeus

Reputation: 159844

You're missing FileTreeModel.java from the compilation path as presented here

Upvotes: 1

Related Questions