What I'm trying to do is create a JTree with each cell containing normal text but also containing a right-aligned text for each cell (right-aligned to the edge of the tree, regardless of the hierarchy level).
I've tried creating my own TreeCellRenderer, but the cells' sizes are not being updated. I also tried this idea with a custom tree UI but am experiencing similar issues.
I also have tried creating a custom component with a JPanel "glued" to the right of the tree. This has been the most successful, but I have been unable to have the tree cells extend to the right and touch this extra panel: