I'm wanting to be able to paint the background of each row of a JTree in a different colour.
Changing the renderer isn't sufficient, as I'd want to be able to paint parts of the row which aren't painted by the renderer - for example, at the LHS of the tree where the toggles and legs are. So I'm talking about the whole row, covering the full width of the tree.
Looking at BasicTreeUI.paint(), it doesn't seem possible to "get in" at the right point. As it's the background, it should really be painted before anything else. However, there's no hook to let you do this sort of thing.
Does anyone have any ideas on how to accomplish this?