更改展开和折叠图像TreeView JavaFX 2.2 [英] Change expand and collapse image TreeView JavaFX 2.2

查看:241
本文介绍了更改展开和折叠图像TreeView JavaFX 2.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以更改JavaFX 2.2 TreeVIew的展开和折叠图像?

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

更改此图片,

对于像这样的图像这个(带+/-),

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

推荐答案

当然,这可能只需要一点点css。
CSS如下所示:

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

lg Kalasch

这篇关于更改展开和折叠图像TreeView JavaFX 2.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆