TreeComponent
An expandable tree of rows.
Java
Inside a PanelComponent constructor. The same call draws in every family and chroma.
Java
TreeComponent<File> files = add(new TreeComponent<>(at(new Box("files", 8, 8, 180, 120)),
List.of(root), File::kids, File::name)
.icon(f -> f.isDirectory() ? Icon.FOLDER : null)
.onSelect(this::preview)
.onActivate(this::open));
files.expand(root);
files.setRoots(List.of(newRoot)); // nodes that are equal stay openRows
