隐藏/更改JTree上的折叠[-]并展开[]按钮 [英] Hide/change collapse [-] and expand [ ] button on JTree

查看:244
本文介绍了隐藏/更改JTree上的折叠[-]并展开[]按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以隐藏Java文件JTree上的折叠[-]和展开[+]按钮?
如果不可能,是否可以将其更改为其他图标?

Is there a way to hide the collapse [-] and expand [+] button on a java file JTree?
If it's not possible, is there a way to change it to a different icon?

推荐答案

两者都可以:您可以指定一个空的Icon,如图所示此处所示.这些是相关的UIManager键:

Yes to both: You can specify an empty Icon, as shown here. You can substitute your own implementation, as shown here. These are the relevant UIManager keys:

UIManager.put("Tree.collapsedIcon", empty);
UIManager.put("Tree.expandedIcon", empty);

这篇关于隐藏/更改JTree上的折叠[-]并展开[]按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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