在包Javax Swing的Tree对象。我们需要设置不同的图标为每个节点。它封装了一个通用的方法:
用法:
jTree1.setCellRenderer(new TreeNodeRender(casesIcon));
须要注意的是caseIcon为一个List<ImageIcon>对象.
示比如图,传入了3个ImageIcon对象,按节点层级放置: