Reputation: 33
Is there a way to hide the collapse [-] and expand [+] button on a java file JTree?
JTree
If it's not possible, is there a way to change it to a different icon?
Upvotes: 3
Views: 2107
Reputation: 205785
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:
Icon
UIManager
UIManager.put("Tree.collapsedIcon", empty); UIManager.put("Tree.expandedIcon", empty);
Upvotes: 6