java - Rendering nodes in JTree with multiple different fonts -
imagine have jtree showing multiple strings - example list of colors. how possible render such tree different color/font combination? how implement treecellrenderer correctly?
thank help.
you can extend defaulttreecellrenderer. in gettreecellrenderercomponent method call super() , check conditions e.g. analysing value. after call setfont(), setbackground() , setforeground() methods accordingly.
Comments
Post a Comment