JavaFX TreeTableView Image artefacts

I'd like to add images to each node in a TreeTableView. In order to do this, i wrote (as per some pages found with Google) the following:

Call to update the view in the views controller

public void refreshView() {

final List> treeItems = new ArrayList();

final Collection onRootLevel = source.getUnitsOnRootLevel();

for (final IUnit unit : onRootLevel) {

treeItems.add(new MyTreeItem(unit));

}

root.getChildren().clear();

root.getChildren().addAll(treeItems);

}

Each item is wrapped

public class MyTreeItem extends TreeItem {

private final IUnit unit;

public MyTreeItem(final IUnit unit) {

super(unit, new LevelImage(unit.getLevel().getIcon()).getImage());

this.unit = unit;

}

}

Each item gets the image converted from a BufferedImage

public class LevelImage {

private ImageView imageView;

public LevelImage(final BufferedImage image)...

Read More »

By: StackOverFlow - Saturday, 21 July

Related Posts