问题
I have a task to create java tree, with three columns: Sport name, Count of sports which are in sport category, and last update. Something similar is dispayed on image bellow:
As you can see, there are 4 kinds of sports: Water, Ball, Skying, Dancing. When I expand skying, there are 3 sports of its kind.
But how to make columns. I can make JTree with nodes and stuff, but how to add columns?
回答1:
Here is a good example for using a Tree
with multiple columns. It looks like this:
I would however suggest using a JFace TreeViewer. There are good tutorials here and here.
回答2:
It sounds like you want a view that expands like a tree but has rows & columns like a table. Consider Outline, cited here.
来源:https://stackoverflow.com/questions/14491237/java-tree-with-columns