gk said:
i want to send a XML string to a pop-up window.
the pop up window would accept the xml string and parse it.
and it will display the parsed elements.
How should it be done ?
should i first parse the XML and put those in the javabean ?
Please tell me the flow , how this could be done ?
You provide very few information to work with. What seems apparent for
me is that you have not GUI centric application architecture in mind.
"send an XML string to a pop-up window" is usually not what one does in
a GUI application (whatever you understand as "send"). Also, a pop-up
window is not where one would typically parse XML. You sound as if you
try to apply a typical batch-job-like flow of control (pushing data
around) in a GUI application. This typically fails in GUI application.
GUI applications are typically event centered. The GUI is in control,
and you don't "send" something to a GUI, instead the GUI requests
information when it seems appropriate for the GUI.
Very popular GUI application architectures are MVC and its many
variants. In this architecture you have a separation of concerns (who is
doing what and when), and clear communication ways (events). And in
fact, Sun's GUI toolkit is based on an MVC variant. I would suggest you
spend some time to learn the principles of the Swing/AWT architecture
first (the comp.lang.java.gui FAQ should contain a pointer to a TSC
article describing the Swing architecture, plus pointers to Sun's GUI
tutorial).
You won't get very fare if you try to beat the existing architecture
into submission by throwing heaps of code onto it.
Once you know the Swing/AWT architecture you can design your
application. You will probably have some model (maybe a TreeModel),
which provides the information from the XML data in a way suitable for a
Swing Component (widget), maybe a JTree. The JTree might end up in some
JDialog, and the JDialog might provide some way to couple the model with
the widget used to display the data.
/Thomas