It may seem a little bit strange, but is there a way to make the last node of JTree expand horizontally rather than vertically? My vertical tree nodes represent different discussion subjects (politics, culture, etc.) and each of those nodes has a list of Article objects. I really need to sort these articles by publication date and place them in the last tree node horizontally.
I hope I was clear, any help or a link is very appreciated. Thank you!
You would have to override the
paintComponent()
method forJTree
and calculate when you were painting the last node. If you were, you would reposition the start point of the painting for theJLabel
which I believe represents a leaf.Regards,
Guido
Edit
From Sun:
Located on this Page: http://java.sun.com/products/jfc/tsc/articles/painting/