tags:

views:

159

answers:

2

I would like to have a JTree which also displays some extra information right adjusted, just like there was an extra column, see picture below. Any hints for accomplishing something like this or similar are welcome!

alt text

+6  A: 

There are some articles at Sun about producing TreeTables in Java.

I remember developing a TreeTable using the sample code as a great starting point, but these articles are 10 years old now so you may want to approach with a little caution.

If you'd like something newer there is the NetBeans Outline Component.

Dave Webb
Thank you, didn't know about that. I'll have a look...
Ed Taylor
They definitely are pretty old by now. I started implementing such a thing a while ago, though development was done by another one later and I don't know in what shape the codebase is. If you're interested, you can download JAMES II at http://wwwmosi.informatik.uni-rostock.de/mosi/plonesoftwarecenter.2006-03-21.4262636143/pscproject.2006-03-21.6122697558/releases and take a look at the package `james.gui.utils.treetable`. The license should permit re-use outside that project.
Joey
I think I'll be able to put something together using this information, thanks.
Ed Taylor
+1 for the NetBeans Outline. It is very simple to use. See this explanation: http://stackoverflow.com/questions/1436281/help-making-a-jtree-with-a-jcheckbox/1436480#1436480
akf
+2  A: 

You can achieve this kind of thing by using and configuring the JTreeTable from SwingX project.

romaintaz
It's name is j_X_treetable and it comes without sorting: http://forums.java.net/jive/thread.jspa?messageID=484525 and without filtering: http://forums.java.net/jive/message.jspa?messageID=234613
bobndrew