Forums Register Login

JTree Row Background Colour

+Pie Number of slices to send: Send
i want to set the background colour for a particular selection in a JTree, the row numbers for which i know. i already have a renderer class of my own which extends DefaultTreeCellRenderer. this class alters the text of the JTree nodes.
How can i set the background colour for certain specific rows?
would appreciate all inputs.
thx
+Pie Number of slices to send: Send
In the getTreeCellRendererComponent in your DefaultTreeCellRenderer you know the row. So you can then just setBackground if the row is one that you want colored.
+Pie Number of slices to send: Send
well i have the row numbers in an array (the ones i want to change the background colour for).
how can i make these available to my renderer's getTreeCellComponent method?
Where does a nanny get ground to air missles? Protect this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 2054 times.
Similar Threads
JTree
Setting JTree Row Components
JTree
JTree question
Subtree in JTree
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 04:15:59.