3

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?

Daniel Widdis
  • 8,424
  • 13
  • 41
  • 63
dozmic
  • 33
  • 4

1 Answers1

6

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);
Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045