Hello,
I would like to change the transparency of a Tag Browse Tree component. I looked around the DefaultTreeCellRenderer. It kind of works but there is something I must not do correctly as the background become “crazy” as soon as i use the Tag Browse Tree (in preview mode).
Here is the code I use :
from java.awt import Color
from javax.swing.tree import DefaultTreeCellRenderer
cellRenderer = DefaultTreeCellRenderer()
btr = event.source.parent.getComponent('Tag Browse Tree')
transparent = Color(0,0,0,0)
cellRenderer.setBackground(transparent)
cellRenderer.setBackgroundNonSelectionColor(transparent)
cellRenderer.setBackgroundSelectionColor(transparent)
btr.viewport.view.background = transparent
btr.viewport.view.setCellRenderer(cellRenderer)
btr.setBackground(transparent)
Window Initialisation:
After launching the script:
After Using the scrollbars:
After unselecting element or after window focus loss (desired appearance):
Is it possible to define the background color without having the color glitches shown in the screenshots ?
Note: Using scrollbars will bring back the weird background on the component, even if it has préviously shown the correct (and desired) background before.
Note: I’ve seen those stange color behaviors when trying to change the Alarme Status component colors as well.
I can provide logs, exports, code, if needed.
Regards.