Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 3 days 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 4 years ago)
- Default Branch: master
- Last Pushed: 2021-06-10T18:22:11.000Z (over 3 years ago)
- Last Synced: 2024-12-03T06:20:23.983Z (2 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
![Java CI with Maven](https://github.com/parubok/directory-tree/workflows/Java%20CI%20with%20Maven/badge.svg?branch=master)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](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.