- you have to override TreeCellRenderer, to enlarge the gap between nodes, override getPreferredSize for nested JPanel that returns its Dimension properly back to Painter
- Renderers concept in Swing is just an illlusion with very intensive painting, then you have to override mouse events (convert from SwingUtilities) if you want to switch betweens
Cards (conflict with colapsing the node)
- don't to use JTree for this idea, search for
Java + Swing + Accordion, or Ribbon, there must be two three very good attempts that is settable
__________________________________________________
-
why you don't do that,
one of good attempts