Java tree with columns

筅森魡賤 提交于 2019-12-14 01:51:00

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!