I have an XML which queries database for some data. I have to display this XML using JTree. Since data is huge it takes lot of time to build and display the tree. Is there anyway the child nodes would get build from XML after we click the corresponding parent node, as i wont be requring to view all child nodes. Pls do help.
Yes, that's right. Similarly, I use a TreeWillExpandListener which gives you advance warning that you are supposed to load the child nodes. And if you already have the data available -- for example if you used a DOM parser and built a DOM that constructs an internal tree -- then you just get the child nodes from that tree and put them into the JTree.
But your original post implied you didn't want to build a DOM because of the size of the document. If that is still the case then looking for Swing solutions isn't going to help.