Greetings everyone,
I'm having a lot of trouble with transparent JTrees,
I've extracted the portion of code that gives problems in a simple executable class:
The real piece of code inside my application is a little (a lot) more complicated, but i found out that a simple class like this one above presents similar problems to mine.
If you play a little with the tree (open and close various nodes several times) you will notice that the nodes tend to overlap one with another, giving an awful visual effect.
Please notice that this does not depend on the GradientPane that contains the tree, because it does the same with a normal JPane.
However, i found a workaround in the case of a non-gradient background, but that's not the thing i'm interested in.
The problem gets even worse if you put the GradientPane into a scrollPane and/or if you use a custom cellRenderer, you will get a real mess as you move around the scroll bars.
It's really important to me to have a gradient background under that tree, but it seems that my experience with swing is really not enough.
P.S.
If that could matter, i'm running on windows.
I don't know if the problem can be reproduced on other systems.
Thanks to everyone kind enough to help.