Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Change expand and collapse image TreeView JavaFX 2.2

Is it possible to change the Expand and Collapse Images of a JavaFX 2.2 TreeVIew?

Change this image,

Valid XHTML

To an image like this (with +/-),

Valid XHTML

like image 742
Georgios Syngouroglou Avatar asked Mar 20 '13 11:03

Georgios Syngouroglou


1 Answers

Sure, this is possible with a little bit of css. The CSS looks like this:

.tree-cell .tree-disclosure-node .arrow {
    -fx-shape: null;
    -fx-background-color: null;
    -fx-background-image: url("plus-arrow.png");
}
.tree-cell:expanded .tree-disclosure-node .arrow {
    -fx-shape: null;
    -fx-background-color: null;
    -fx-background-image: url("minus-arrow.png");
}

lg Kalasch

like image 134
Kalaschni Avatar answered Sep 30 '22 09:09

Kalaschni