Frequently Asked Questions

What platforms does UIKit work on?

UIKit is written entirely in Java. It should work under any virtual machine which supports JDK 1.1 or later. This makes it perfect for applets as well as applications.

Can I include my own custom components in UIKit layouts?

Yes. Almost any Object can be defined in an interface definition file. The only requirement (and there are exceptions even to this) is that it must have a constructor which takes no arguments. In addition, if you want to specify a property value in the file, the object must have an appropriate setXXX() method.

Can I use UIKit in commercial programs?

Yes. UIKit is completely free, and distributed under a very liberal license. You can do almost anything with it so long as you give due credit for it.

Does UIKit work with Swing?

UIKit can create Swing components just like any other Java objects, but it is not specifically designed for creating Swing layouts. For example, it does not know how to added JMenus to a JFrame, or how to make full use of some of the Swing layout managers. It would be quite simple to modify it to correct these problems, and you are certainly welcome to do so. I have no plans to do so myself, however. I regard Swing as an abomination, and don't want to do anything that could possibly encourage anyone to use it. (Ok, it's not that bad if you ignore the painfully slow performance, the ludicrous memory requirements, the depressingly badly implemented text editing, the "imitation" components that behave almost-but-not-quite like real native components...except for a few particularly egregious cases that don't even come up to the level of "almost"...perhaps I had better stop now. :)

What XML parser does UIKit use?

UIKit was written to use Sun's JAXP XML parser. It would be quite simple, however, to modify it to use any other parser which conforms to the World Wide Web Consortium's Document Object Model interface.

How does UIKit compare to Sun's Archiver package and IBM's Bean Markup Language?

Sun's Archiver and IBM's Bean Markup Language (BML) are both technologies which allow sets of objects to be reconstructed from XML files. In this sense, they are quite similar to UIKit. Both of them were designed to address much larger and more general sets of problems than UIKit, however. Archiver is intended to be a general purpose object serialization mechanism. BML is designed to be a complete programming environment, in which you create entire programs (or large sections of programs) by connecting beans together, using embedded JavaScript to add intelligence and manage the communication between the beans.

In contrast, UIKit is intended to do one specific thing very, very well: creating user interfaces for Java programs. As a result, it is faster, simpler, and easier to use than either of the other packages.

For example, suppose that you want to create a Label which says "Hello!" in bright red, 18 point, bold, serif text. Here is the necessary XML for Sun's Archiver.

<OBJECT CLASS="Label"> <OBJECT PROPERTY="text" VALUE="Hello!"/> <OBJECT PROPERTY="foreground" CLASS="Color"> <OBJECT CLASS="Integer" VALUE="-65536" /> </OBJECT> <OBJECT PROPERTY="font" CLASS="Font"> <OBJECT VALUE="Serif" /> <OBJECT CLASS="Integer" VALUE="1" /> <OBJECT CLASS="Integer" VALUE="18" /> </OBJECT> </OBJECT>

Now here is the necessary XML for UIKit to create the same component:

<Label text="Hello!" foreground="red" font="serif-bold-18" />

In spite of its greater simplicity, UIKit is still extremely flexible. There is nothing special about Label objects. When UIKit parses the above XML, it uses reflection to look up the Label class, create an instance of it, find the setText() method, determine what type of argument it takes, etc. Including your own custom objects is every bit as simple.