Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > Upside down pyramid JTree?

Reply
Thread Tools

Upside down pyramid JTree?

 
 
RC
Guest
Posts: n/a
 
      02-21-2007
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!
 
Reply With Quote
 
 
 
 
Sundar
Guest
Posts: n/a
 
      02-22-2007
On Feb 22, 2:15 am, RC <(E-Mail Removed)> wrote:
> 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/...ing/JTree.html


-Sundar
http://heysundar.blogspot.com

 
Reply With Quote
 
 
 
 
Rogan Dawes
Guest
Posts: n/a
 
      02-22-2007
RC wrote:
> 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
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Upside Down Nowhere Computer Support 31 01-30-2006 09:05 PM
Kodak Picture Disk...pics are upside down Bob Hayden Digital Photography 4 07-13-2005 08:44 PM
Help! Upside down blurry pictures with HP Photosmart 320. BlackJackGirl Digital Photography 0 12-06-2004 05:17 AM
Icons are upside down...how to correct MBell72398 Computer Information 3 12-19-2003 05:56 AM
Icons upside down...FIXED MBell72398 Computer Information 3 12-18-2003 07:43 PM



Advertisments