JLIB -- a high-level interface to the Java AWT

The key idea is to use the flexibility and expressiveness of Scheme to create a GUI-building library which allows complex GUIs to be built by evaluating a simple and declarative expression whose structure closely resembles the structure of the GUI itself.

The JLIB model is based on five fundamental concepts:

Another key idea is that operations on all components should be as uniform as possible. For example, there are procedures "readstring" and "writestring" which allow one to read a "string" from a component, and write a string onto a component. Thus "writestring" can change the string on a label, a button, a textfield, a textarea. It can also change the title of a window or add an item to a choice component. Likewise, readstring returns the label of a button, the text in a textarea or textfield, the text of the currently selected item in a choice, the title of a window, and the text of a label.

Similarly, JLIB is designed so that the component and layout constructors require a few initial arguments of specified types, followed by many optional arguments which may apper in any order and whose types are used to determine their effect.

For example, a font object will change the font of the component, a color object will change the background color, a Listener object will add an action listener to the component, a string will generally become the label of the object.

The current JLIB primitives are listed below:


Components are created using the functions below. The optional arguments are described in the next section and can be used to set the color, font, and other properties of the component. The type of the argument is used to determine how it affect the component.


Arguments to Components and Layouts


The current JLIB is accessible here and we have a SWING version as well, which is accessible here To get the most uptodate version you should download the latest jscheme source from CVS.