Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / January 2006

Tip: Looking for answers? Try searching our database.

XML parsing

Thread view: 
gk - 09 Jan 2006 13:15 GMT
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 ?
Thomas Weidenfeller - 09 Jan 2006 13:48 GMT
> i want to send a XML string to a pop-up window.
>
[quoted text clipped - 7 lines]
>
> 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
Signature

The comp.lang.java.gui FAQ:
ftp://ftp.cs.uu.nl/pub/NEWS.ANSWERS/computer-lang/java/gui/faq
http://www.uni-giessen.de/faq/archiv/computer-lang.java.gui.faq/



Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.