JTree bizarreness

Discussion in 'Java' started by John, Mar 15, 2005.

  1. John

    John Guest

    I use JTrees all the time, but I have come across some strange
    behaviour. This one has a custom CellRenderer and a custom TreeModel.

    If I configure the tree elsewhere and then execute this code, "3" will
    be printed for some TreeModels but not for others (no exceptions etc.,
    it just stops at orderTree.setModel(tm)!).

    System.out.println("1");
    TreeModel tm = ldm.getOrderTreeModel(orderNumber);
    System.out.println("2");
    orderTree.setModel(tm);
    System.out.println("3");

    Bizarrely, if I create / configure a new JTree each time, all TreeModels
    work.

    I could spend a bit of time creating a self contained example, but was
    wondering if any readers have experience of this sort of problem.

    John
    John, Mar 15, 2005
    #1
    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. Mike Labosh

    Unload Bizarreness

    Mike Labosh, May 25, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    373
    Alvin Bruney [MVP - ASP.NET]
    May 26, 2005
  2. Christophe Boutin

    double click in a jtree

    Christophe Boutin, Jul 24, 2003, in forum: Java
    Replies:
    1
    Views:
    13,071
    catalysoft.com
    Jul 25, 2003
  3. Pavel
    Replies:
    1
    Views:
    3,132
    Pavel
    Jul 25, 2003
  4. Abraham Khalil
    Replies:
    0
    Views:
    4,730
    Abraham Khalil
    Sep 17, 2003
  5. jumpz
    Replies:
    3
    Views:
    616
    Jean-Baptiste Nizet
    Nov 12, 2007
Loading...

Share This Page