Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / GUI / February 2007

Tip: Looking for answers? Try searching our database.

Upside down pyramid JTree?

Thread view: 
RC - 21 Feb 2007 21:15 GMT
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!
Sundar - 22 Feb 2007 08:46 GMT
> 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!

I dont think its possible with jTree. I never came across such method/
setting in jTree. Here is the reference:
http://java.sun.com/j2se/1.4.2/docs/api/javax/swing/JTree.html

-Sundar
http://heysundar.blogspot.com
Rogan Dawes - 22 Feb 2007 09:58 GMT
> 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


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.