There are at least two ways to approach building an application that combines Java and XML. One involves using a toolkit; that was covered in last week's article. In this second of two parts, you'll learn what is available for the second approach: using an integrated development environment.
In a recent article, I looked at some of the available UI toolkits that use XML to define an application user interface and Java as the program logic. Combing Java and XML in this way has many benefits, but using the toolkits can be tricky due to poor documentation and non-standard implementations. In addition to the large number of UI toolkits, there are also some great applications and WYSIWYG applications aimed at giving you a more visual approach to creating XML interfaces and making the whole process of development easier. This is what this article is going to focus on. Using XML with Java is a great way of specifying an application's user interface and using a GUI editor is a great way to achieve it.
XAMJ is a fairly new specification. It makes use of a browser application called Warrior. Warrior is an open source browser/platform that renders .xamj documents in the same way that your HTML browser is rendering this page. It is a very current project; it was last updated just a couple of months ago and the last application update was August 6, so this is very much an initiative in progress as we speak. XAMJ (Xml Application Markup for Java) is a strict XML based mark-up language that was proposed to provide a method of constructing rich Internet applications and possibly, of replacing HTML. To begin using XAMJ, all you need to do is download Warrior (which comes in the form of a jar file). Once Warrior is installed, you can create .xamj files using a standard text editor; these files can then run as either standalone applications or within Warrior itself.
The application UI is manufactured from a set of very simple XML tags that will be familiar to most developers, using standard tags like <hbox> or <button> for example. Java code can then be inserted into special declaration tags (<decl>) to power the application from within, although make your own mind up as to what this does for the separation of presentation and program logic. Normal Java class files can also be used, however, if needed as well. This method of UI design seems like an excellent way for beginners to get into using XML and Java for application development; all you need do is install Warrior and you can begin experimenting. There is some good documentation including some excellent tutorial material at Http://xamjwg.org/index.xamj (which can be viewed in Warrior or a standard web browser of your choice). Overall, this was very easy and quick to use.