How to remove folder symbol which comes in front of each node from JTree in java

后端 未结 3 668
抹茶落季
抹茶落季 2020-12-11 07:43

I am trying to remove the folder symbol from node of JTree which comes by default. How can I accomplish this?

3条回答
  •  既然无缘
    2020-12-11 08:21

    The Swing tutorial talks specifically about doing this:

    http://download.oracle.com/javase/tutorial/uiswing/components/tree.html#display

    You can easily change the default icon used for leaf, expanded branch, or collapsed branch nodes. To do so, you first create an instance of DefaultTreeCellRenderer.

提交回复
热议问题