https://github.com/parubok/directory-tree
Java Swing JTree model with a hierarchy of filesystem directories.
https://github.com/parubok/directory-tree
directory-tree java java-swing jtree swing
Last synced: 5 months ago
JSON representation
Java Swing JTree model with a hierarchy of filesystem directories.
- Host: GitHub
- URL: https://github.com/parubok/directory-tree
- Owner: parubok
- License: apache-2.0
- Created: 2021-03-13T04:35:00.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-10T18:22:11.000Z (over 4 years ago)
- Last Synced: 2025-01-30T10:44:13.625Z (11 months ago)
- Topics: directory-tree, java, java-swing, jtree, swing
- Language: Java
- Homepage:
- Size: 72.3 KB
- Stars: 1
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README

[](https://github.com/parubok/directory-tree/blob/master/LICENSE)
# directory-tree
The goal of this project is to provide an efficient and convenient implementation of Java Swing JTree model with
a hierarchy of a local filesystem directories (e.g. for directory chooser component).
Note: Though the model itself does not provide any builtin support for asynchronous operations, it can be built and
prepopulated (via `DirTreeModel.getTreePath`) on any thread and then passed to the EDT.
Example:
```java
import org.swingk.io.dirtree.DirTreeModel;
import org.swingk.io.dirtree.DefaultNodeFactory;
import org.swingk.io.dirtree.DirTreeUtils;
import javax.swing.JTree;
var model = new DirTreeModel<>(DirTreeUtils.NAME_COMPARATOR, true, true, new DefaultNodeFactory());
JTree tree = new JTree();
DirTreeUtils.configureTree(tree, model);
```
A demo application is provided. See `org.swingk.io.dirtree.demo.Demo`.
This library is packaged as a Java 9 module `org.swingk.io.dirtree` (with a single dependency on a system module `java.desktop`).
This project has no external dependencies (except JUnit 5, for testing).
Requires Java 11 or later.