动态更改Jtree中一个或多个节点的颜色 [英] Change the color of one or more nodes in Jtree dynamically

查看:94
本文介绍了动态更改Jtree中一个或多个节点的颜色的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用根节点和4个子节点创建了Jtree.
我的问题是这样的:

I have created Jtree with Root node and 4Subnodes.
My problem is like this:

  • 我需要 动态更改特定节点的前景色和背景色.
  • I need to change the foreground and background color of a particular node dynamically.

我该怎么办?
帮我一些代码.

预先谢谢大家...

How can i do it?
Help me with some piece of code.

Thank you all in advance...

推荐答案

我该怎么办?

How can i do it?

我确定 JTree教程包含有价值的内容关于 DefaultTreeCellRenderer

I'm sure that JTree tutorial contains valuable info about DefaultTreeCellRenderer,

帮我一些代码.

Help me with some piece of code.

大量示例此处此处

这篇关于动态更改Jtree中一个或多个节点的颜色的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆