2

When I add a node to the JTree dynamically and call tree.updateUI() on Mac OSX, it works, but when I move the jar to Windows, it does not update the tree. This is only in the runnable jar mode. If I just run it in Eclipse, it works just right.

In Windows, I suppose that it sort of updates it by showing there is a child node under the root node, but does not display the child node. It should be showing the child node as well.

What should I try to solve this problem?

Is it how I build the runnable jar? I used Eclipse export thingy. If so, is there a better way to make it?

Thanks in advanced.

mKorbel
  • 109,525
  • 20
  • 134
  • 319
Scott Deutsch
  • 637
  • 1
  • 8
  • 24

1 Answers1

4

The updateUI() method is not intended for this use. Instead, tell the tree model to reload() the affected node, as shown here.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045