new JavaFX Tree Item - Java JavaFX

Java examples for JavaFX:Tree

Description

new JavaFX Tree Item

Demo Code


//package com.java2s;

import javafx.scene.control.TreeItem;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;

public class Main {
    public static <T> TreeItem<T> newTreeItem(TreeItem<T> parent, T value,
            Image image) {//from   ww w . j  av  a  2  s .  com
        final TreeItem<T> item = new TreeItem<>(value, new ImageView(image));
        parent.getChildren().add(item);
        return item;
    }
}

Related Tutorials