Monday, June 11, 2012

Dynamically create Swing GUI from generic XML

http://stackoverflow.com/questions/8503661/dynamically-create-swing-gui-from-generic-xml

I think I know what you're asking for...
How about using SwiXML plus Java's inbuilt XML APIs.
SwiXML would solve the Swing form generation, and Java's built-in XML APIs could bridge the gap between this and your 'generic xml format'. The Java DOM API would provide everything you need for transforming and generating XML.
Overview:
  1. You could transform your 'generic xml' document into SwiXML's XML format, using one of Java's XML APIs such as DOM or SAX (or even an XSLT transformation).
  2. Then you could invoke SwiXML on the resulting SwiXML markup.
  3. Finally, you'd get your Submit button's ActionListener to generate the 'generic output XML' using e.g. Java's DOM API.
Hope this helps!

No comments:

Post a Comment