0

this is my first post, I'm actually implementing JXtreetable component, which I have managed to display all the data contained in it, but I want to create a custom cell rendering in order to display parent's row different with their child (i.e make the font to be bold), is there anyone that can help? So far,I can only change column's render by using

myTreeTable.getColumn (int col). setCellRenderer (myRendererObj);

where I had made earlier myRendererObj,

Roufiq
  • 21
  • 3

1 Answers1

1

You can use the setTreeCellRenderer(...) method of JXTreeTable. You give it a DefaultTreeRenderer which you can then give a ComponentProvider. I subclassed ComponentProvider to do my custom tree cells.

whatknight
  • 303
  • 1
  • 7
  • thanks for your solution, but I still couldn't figure how it implemented,now I have some alternative solution in order to differentiate each children on my treetable, simply using class 'ColorHighlighter' 'myTreeTable.setHighlighters(new ColorHighlighter(new DepthHighlightPredicate(int lvlChild), Color(background), Color(foreground)));' – Roufiq Jul 12 '12 at 04:47
  • The method I mentioned is useful if you need to dramatically change the components you want to render in the the tree. All of the classes I mentioned are in SwingX 1.6.3. The Javadoc is here: http://www.abusingjava.net/AbusingSwing/doc/SwingX-1.6.3/index.html?overview-summary.html – whatknight Jul 12 '12 at 12:58