I have created a custom JTree. That tree could be filtered to show only those nodes that contains given criteria (string). Now, is there any way to bold only that part of DefaulMutableTreeNode that contains searched string?
If a tree node has label = "StackOverflow" and user is searching for nodes that contains "Stack", "StackOverflow" node would be rendered with "Stack" part bolded.
How to achieve that?
You need to set your own
TreeCellRenderer
.Example:
The code below produces this screenshot: