How: JTable with a legible JTree in the first column and data in other columns?

I lost a little at this point: I'm trying to create a JTable that can contain some Tree data structure (JTree?) In the first column, followed by Node-based data in other columns, as shown in the following image:

enter image description here

This image shows the structure of my JTree. Red lines indicate the table structure that I will need to implement. Each Node in the tree should be treated as one row in this table, etc. I hope it is clear what I am trying to achieve.

I tried aproach, as discussed here: JTable as JTree Node and here Put JTable in JTree , but it does not fit my needs. I also read about JXTreeTable from the SwingX project, but it seems very difficult to find useful examples. Also, many links to such solutions seem to lead to the (already defunct) sun websites and / or redirected to the oracle website ...

It would be great if someone could lead me in the right direction and / or provide some exmaple code on how to do this (right).

Any help would be appreciated;).

+7
java swing jtree jxtreetable jtreetable
source share
1 answer

Create your own TreeTable component, as in the following link: http://www.java2s.com/Code/Java/Swing-Components/JTreeTablecomponent.htm

+5
source share

All Articles