I’m making a treeCellRenderer for a program, and I’m looking at the documentation for getTreeCellRendererComponent. Even looking at the example, DefaultTreeCellRenderer it isn’t clear: What does int row do?
Even some of the examples I found on the web doen’t use it. Does anyone use it? How should I implement it in my code?
It contains the number of the row this Renderer is called for. So you can render the component dependent on the row number. You might want to implement alternating row colors this way.
Try to set a breakpoint in that method and see how the value of
rowbehaves.