public interface TreeCellRenderer
Component getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)
value
当前树的单元格的值。如果
selected
是真实的,细胞会得出如果选择。如果是真的
expanded
节点目前正在扩大,如果
leaf
真实节点代表一个叶节点如果
hasFocus
是真正的焦点。
tree
是
JTree
接收器被配置为。返回
Component
,渲染器使用画的价值。
的TreeCellRenderer
还负责绘制单元表示树的DND的放置位置如果有。如果这个渲染器渲染DND关心放置位置,应查询树直接查看给定行代表放置位置:
jtree.droplocation droplocation =树。getdroplocation();如果(droplocation!= null与droplocation getchildindex() = = 1。和树。getrowforpath(droplocation。getpath())= =行){这一行表示当前的拖放位置使它特别,也许有一个不同的颜色}
Component
,渲染器使用画的价值
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.