JTree bizarreness

J

John

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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top