Java GUI 三态导航树(3)

if (selected)
                {
                    panel.setBackground(getBackgroundSelectionColor());
                    label.setForeground(getTextSelectionColor());
                }
                else
                {
                    panel.setBackground(getBackgroundNonSelectionColor());
                    label.setForeground(getTextNonSelectionColor());
                }

panel.setComponentOrientation(tree.getComponentOrientation());

return panel;
            }
        }

return super.getTreeCellRendererComponent(tree, value, selected, expanded, leaf, row, hasFocus);
    }
}

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/wwpzpw.html