MrD
MrD

Reputation: 2481

Java tree with columns

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:

Design of JTree

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?

Upvotes: 2

Views: 4045

Answers (2)

trashgod
trashgod

Reputation: 205785

It sounds like you want a view that expands like a tree but has rows & columns like a table. Consider Outline, cited here.

image

Upvotes: 2

Baz
Baz

Reputation: 36884

Here is a good example for using a Tree with multiple columns. It looks like this:

enter image description here

I would however suggest using a JFace TreeViewer. There are good tutorials here and here.

Upvotes: 2

Related Questions