my problem is this
I’m trying create a component that displays two tree side by side. The two trees will generally be very similar but will probably have one or two differences. Where there is a difference, ie a branch in one but not in the other, I would like the tree without the branch to show an empty space for it, and for each of its missing children too.
So it might look something like
left tree right tree ------------ ------------- + Root + Root | | --Child A --Child A | | --Child B | | | --Child C --Child C
Its relatively straight forward to remove the text and icon for those rows that should be gaps using a custom renderer. However, this still leaves the horizontal line that connects a child to the parents vertical line. And this is my problem.
left tree right tree ------------ ------------- + Root + Root | | --Child A --Child A | | --Child B -- <--I want to remove this | | --Child C --Child C
It’s maybe bareable in this simple example but when the missing branch has children too I end up with lots of small lines connecting gaps.
A potential alternative I think is to create a one column JTreeTable for each tree and blank out the cells for the missing branches. Although this will mean that a portion of the vertical line will also be lost.
Any help, ideas or comments will be very much appriciated. Thanks.
Consider the following:
Usage example: