Avinash Rakkasagi wrote:Can someone please modify the code so that I can display the result in GUI format with compress and expand features
Well champ, you have to
TellTheDetails. For instance, what is the structure of your XML file? Where/how do you want it do be displayed?
Anyway, we'll do even better: you will tell you how you could structure your code so you can achieve your goal!
First, what you can do is define an interface that will abstract the reading of your XML file. You have nodes that represent a data structure that keeps information about particular objects in your XML, right? Let's say that your XML file keeps information about people, so let's say that the node is Person. In the constructor of the implementation of this interface, you can read the XML file, given its path. Then, you can consume the methods offered by this interface in your window. You can instantiate the objects in the main method of your application.
Please take a look at it and let us know if you have doubts!
Cheers, Roberto Perillo
SCJP, SCWCD, SCJD, SCBCD