First off, this should be posted in the Swing forum. Second, it's been a while since I worked with JTrees, but I suspect that you are trying to add a node on a
thread other than the swing event thread. Remember most swing components are not thread safe. Usually you will get a flurry of exceptions when you try to change a swing component on the wrong thread, sometimes it just seems to ignore you. There are a couple of ways around this. You can use
SwingUtilities.InvokeLater(Runnable runner) or
SwingUtilities.invokeAndWait(Runnable runner), or you can do the update using javax.swing.Timer and provide an ActionListener since javax.swing.Timer runs on the swing event thread. Without running your code, I can't say for sure what the problem is, but this is a common problem that many developers have when they first start working with swing.
Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius - and a lot of courage - to move in the opposite direction. - Ernst F. Schumacher