Upside down pyramid JTree?

R

RC

Currently when you construct a JTree, it is a
pyramid tree (root on top, branch nodes on bottom).
Is possible make JTree upside down pyramid tree (root
on bottom, branch nodes on top)?

Thanks!
 
R

Rogan Dawes

RC said:
Currently when you construct a JTree, it is a
pyramid tree (root on top, branch nodes on bottom).
Is possible make JTree upside down pyramid tree (root
on bottom, branch nodes on top)?

Thanks!

You would need to do some custom coding, but it probably wouldn't be
*that* difficult. I would look at the drawing code (paintComponent?),
and see how it does its calculations.

Then, rather than starting from an origin of (0,0), and adding offsets
to figure out where to render nodes, start by calculating the height of
your tree, then use that height and subtract offsets to figure out where
to paint the nodes.

Regards,

Rogan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Modify JTree look and feel 7
Extra Row in JTree 6
JTree navigation 1
Updating JTree When Adding Nodes 2
JTree Selection 1
Display an image in a JTree 2
JTree problem 2
How to serialize/deserialize a JTree ? 1

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,575
Members
45,053
Latest member
billing-software

Latest Threads

Top