+2  A: 

[There are some details missing, such as: what type of processing is happening each time the user updates the JTextPane? Is the whole tree being rebuilt?]

Anyway, what has worked for me in the past (when I experienced significant slowdown due to JTree updates) is that I rolled out my own TreeModel.

Most programmers choose to use DefaultTreeModel. This is indeed an off-the-shelf solution that works well in most cases. However, it is quite slow when significant parts of the tree needs to be updated. Obviously, Writing your own TableModel is more work than using a canned solution, but it is much less painful than you think.

In particular, my custom tree model is fast because it does not build any tree, per-se. It just observes my domain model and computes the answers to the method invoked on it (getChild(), getParent(), ...) by extracting the relevant information from that model. Try it. It works like a charm.

Itay
Thank you! I've added further information to my answer.
java.is.for.desktop
Ok, I'll work this tutorial through: http://java.sun.com/docs/books/tutorial/uiswing/components/tree.html#data *(scroll deeper to "How to Load Children Lazily")*
java.is.for.desktop
+1  A: 

I do not know why it only works with invokeAndWait() (this is strange), but a simple hack would be to invoke this method in a new background thread.

I would also advise you not to populate all the tree at once. This is often a huge amount of work that just cannot be easily sped up. Instead, update only those nodes that are visible and update more nodes as the user expands them.

pajton
Here's an example demonstrating lazy loading: http://www.jroller.com/Thierry/entry/swing_lazy_loading_in_jtree
James P.
A: 

Maybe its your cell renderer that needs optimizing. Can you post your cell renderer code?

Chuk Lee