c o n t e n t s

A Pair of Java Desktops, Part 1: PJE

This is a story about two Java UIs. The first was written around the JDesktopPane. Once it was up and running, Avalon came along and gave one of the original project's participants, Paul Hammant, some interesting ideas. This has lead to the second desktop.

In The Beginning, Portable Java Environment

For me, this effort had its genesis as a simple visual interface for an application I started to write back in April of 2000. As I wrote the Java UI for the app, it suddenly dawned on me that it could be reused if the UI portion was pulled and re-written to be more generic. The idea went over like a lead balloon with the head of the office where I was working. I left in May along with my ideas, and during the next two months (June and July) I managed to pull something together and to attract a bit of attention (a minor bit, to be sure).

The idea was very simple. Create a framework, based on JDesktopPane, into which you could insert applications that were attached to JInternalFrames. The applications were derived from, or are a part of, Component. Each application had its own configuration file, first written as an Java ini file, and later as an XML file. What was key was the ability to run applications on the same desktop and in the same VM. What follows are four screen shot thumbnails showing where PJE is right now.

Our first figure shows PJE in all its glory, with three small apps running in it. The desktop itself is running on Windows in a standard JFrame. At the bottom of the desktop is a typical application launcher. It owes its look to Gnome and KDE. Across the top is an application manager. Applications running on the desktop show up in the manager, and the manager behaves just like Windows 98/ME/2000. If the application has the focus, and you click on its button, it will minimize to the manager. Click on it again and it shows back up. The standard behavior of JDesktopPane was over-ridden.
The second figure shows a simple clock app. The original application was a browser applet that Paul Hammant moved (with very little effort) into a Component, then dropped into a JInternalFrame. Later, I added the simple calendar panel to the left. I finished up with a bit of Java2D to smooth out the drawn hands on the clock face.
The next figure shows a simple editor. No syntax highlighting, just a way to wack up text real fast. I wrote it to work with the Cursor class. I created a block cursor to replace the thin cursor that is standard with the Java text area.
Finally, an example of wrapping a fairly non-trivial pre-existing application in PJE. Once again Paul Hammant took SwingSet2 (in its jar file) and instantiated it as an application in PJE.

Next, the Jesktop...

Home Code Corner Opinions Diary Family jesktop 1