JTree
uses DefaultTreeCellRenderer
as cell renderer.
This class is a subclass of JLabel
.
I want to use JTree
with more complex elements than JLabel
, such as
JTextPane
.
Problem is: I can't subclass DefaultTreeCellRenderer
, because it
would still be a JLabel
.
Writing an own TreeCellRenderer
is too complex.
Why? Because: DefaultTreeCellRenderer
has 17 fields,
and does much more than just implementing TreeCellRenderer
's
getTreeCellRendererComponent(...)
.
What simple solution can you devise?
I need the tree elements to be JTextPane
s to be able to perform complex formatting.