I have an application that displays a jTree. Each node in the tree has a boolean field called flagged
which indicates whether it requires attention or not from the user.
If the field is true
, then I would like it to be highlighted in red, otherwise no highlighting.
What is a good way to accomplish this? Should I extend DefaultTreeCellRenderer
? Implement my own custom TreeCellRenderer
? Some other method?