posted 14 years ago
At the moment I have a partial solution, which allows to select a tree node by clicking anywhere in the row(but it won't highlight the whole row). JTree selects a row whenever the user clicks the renderer component. I think highlighting the whole row can be achieved by sizing the renderer somehow to fit the remaining width in the row. This would make the first part unnecesseary since the renderer would fit the whole row.
I tried to size the renderer component in the getTreeCellRendererComponent method, but that did not work. I think JTree resizes the components after I pass it from getTreeCellRendererComponent .
So I'm stuck at this point.
Here's the code of my tree:
And here's the code of the renderer: