Swixml

SwiXml, is a small GUI generating engine for Java applications and applets. Graphical User Interfaces are described in XML documents that are parsed at runtime and rendered into javax.swing objects.

Depending on the application, XML descriptors may be deployed with the remaining code or loaded from a remote server at runtime. This late binding of the GUI has many advantages. Enabling features in an application based on a license code or a user’s role does not have to be hard coded anymore. Instead an XML document describing the application’s GUI could be dynamically loaded.

Generating the GUI based on descriptors also has some of the advantages that code generators provide, but without generating the non-maintainable code.

While SwiXml doesn’t free the developer from knowing the javax.swing package, it reduces the amount of repetitive, sometimes error prone, and often complex GUI related code.

Constructing a User Interface based on XML documents is not a totally new idea. Projects like Thinlet, XUL, XULUX, Jelly, and SwingML, to name a few, have successfully proven this concept.

  • SwiXml differentiates itself from the rest by focusing completely on javax.swing.
  • Programmers who know Swing already can immediately start writing descriptors. No additional XML dialect has to be learned: Class names translate into tag names and method names into attribute names.
  • SwiXml is faster since no additional layers had to be added on top of the Swing objects.
  • SwiXml is smaller. Despite the fact that the swixml jar file is only about 40 Kbyte in size, almost all of the infamous Swing objects are supported.
  • SwiXml does Java Swing GUI generation and that is all. The dynamic behavior of the user interface, defining the application’s business rules, has to be coded in Java.

 

   SwiXml, source code hosted on github.

Version 2.4 Build 240 of the SwiXml library (incl. Java source code as well as TAG and API documentation.) Requires Java 6.0 or later and supports JGoodie FormLayout.