Upside down pyramid JTree?

Discussion in 'Java' started by RC, Feb 21, 2007.

  1. RC

    RC Guest

    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!
     
    RC, Feb 21, 2007
    #1
    1. Advertising

  2. RC

    Sundar Guest

    On Feb 22, 2:15 am, 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!


    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
     
    Sundar, Feb 22, 2007
    #2
    1. Advertising

  3. RC

    Rogan Dawes Guest

    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
     
    Rogan Dawes, Feb 22, 2007
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KenH

    Text Printing Upside Down

    KenH, Apr 10, 2007, in forum: Java
    Replies:
    9
    Views:
    527
    Andrew Thompson
    Apr 11, 2007
  2. jumpz
    Replies:
    3
    Views:
    648
    Jean-Baptiste Nizet
    Nov 12, 2007
  3. Stefan Ram
    Replies:
    1
    Views:
    404
    Arne Vajhøj
    Feb 14, 2009
  4. jc_usernet

    Upside down font with graphics

    jc_usernet, Dec 5, 2009, in forum: Java
    Replies:
    3
    Views:
    1,673
    Roedy Green
    Dec 8, 2009
  5. Chris Metcalfe

    Ruby .read image upside down?

    Chris Metcalfe, May 29, 2008, in forum: Ruby
    Replies:
    3
    Views:
    136
    Chris Metcalfe
    Jun 11, 2008
Loading...

Share This Page