How do you build a JTree with no root whatsoever (or its placeholder space)?

Discussion in 'Java' started by lbrtchx@hotmail.com, Aug 9, 2007.

  1. Guest

    Check out Marti Hall's examples at:
    ~
    http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JTree.html
    ~
    on the last example "5.2. Replacing the Icons: Result"
    ~
    if you declare your root node like this:
    ~
    root = new DefaultMutableTreeNode();
    ~
    you wont get any label for the root object, but some space shows
    there anyway
    ~
    How do you rid the space too?
    ~
    THanks
    lbrtchx
     
    , Aug 9, 2007
    #1
    1. Advertising

  2. wrote:

    > Check out Marti Hall's examples at:
    > ~
    > http://www.apl.jhu.edu/~hall/java/Swing-Tutorial/Swing-Tutorial-JTree.html
    > ~
    > on the last example "5.2. Replacing the Icons: Result"
    > ~
    > if you declare your root node like this:
    > ~
    > root = new DefaultMutableTreeNode();
    > ~
    > you wont get any label for the root object, but some space shows
    > there anyway
    > ~
    > How do you rid the space too?
    > ~
    > THanks
    > lbrtchx
    >

    Jtree.setRootVisible(false);
    --
    Sabine Dinis Blochberger

    Op3racional
    www.op3racional.eu
     
    Sabine Dinis Blochberger, Aug 10, 2007
    #2
    1. Advertising

  3. Guest

    > On Aug 10, 4:33 am, Sabine Dinis Blochberger <> wrote:
    >
    > Jtree.setRootVisible(false);
    > --

    ~
    Well, this would also erase the little lines representing connections
    to the tree's "Root". Is there a way to only get rid of the space
    left?
    ~
    lbrtchx
     
    , Aug 11, 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. Shuo Xiang

    Stack space, global space, heap space

    Shuo Xiang, Jul 9, 2003, in forum: C Programming
    Replies:
    10
    Views:
    2,925
    Bryan Bullard
    Jul 11, 2003
  2. Christian Seberino
    Replies:
    21
    Views:
    1,693
    Stephen Horne
    Oct 27, 2003
  3. Ian Bicking
    Replies:
    2
    Views:
    1,038
    Steve Lamb
    Oct 23, 2003
  4. jumpz
    Replies:
    3
    Views:
    631
    Jean-Baptiste Nizet
    Nov 12, 2007
  5. nail

    Build control in a placeholder or like a placeholder

    nail, Sep 10, 2004, in forum: ASP .Net Building Controls
    Replies:
    0
    Views:
    346
Loading...

Share This Page