HomeDigital EditionSys-Con RadioSearch Java Cd
Advanced Java AWT Book Reviews/Excerpts Client Server Corba Editorials Embedded Java Enterprise Java IDE's Industry Watch Integration Interviews Java Applet Java & Databases Java & Web Services Java Fundamentals Java Native Interface Java Servlets Java Beans J2ME Libraries .NET Object Orientation Observations/IMHO Product Reviews Scalability & Performance Security Server Side Source Code Straight Talking Swing Threads Using Java with others Wireless XML

Interacting with software can be extremely annoying or incredibly exciting depending on the user interface. While one GUI can leave you hopelessly confused and deny the execution of simple tasks because you can't find the right button, another GUI can draw you in with its appealing and conclusive features, making the implementation of even complex procedures a walk in the park.

For a long time, the development of graphically advanced user interfaces was something only desktop software developers could do, as Java simply lacked the respective toolsets. AWT and later Swing have tried to fill the gap, but are still greatly limited compared to Microsoft's Windows OS or Apple's Mac OS X.

With the growing range of end-user devices that directly support Java, it's increasingly becoming the one true platform-independent environment every developer has been waiting for if only the graphical user interface frameworks could compete with their native counterparts on Windows or Mac OS.

This is where Our World Live's (OWL) Human Interface Package (HIP) comes in. HIP 1.0 for PersonalJava and HIP 1.0 for Java 2 (J2SE and J2EE) are two user-interface frameworks that provide a complete set of out-of-the-box APIs and, according to OWL, "transcend the limitations of AWT and Swing and revolutionize the development of Java GUIs in 100% Pure Java."

HIP 1.0 PJ
HIP PJ, written entirely in Java, is OWL's user-interface framework that complies with PersonalJava 1.2 (JDK 1.1.8), which you'll find in most TV set-top boxes, Pocket PCs, and Nokia and Ericsson cellphone communicators. The most common virtual machine for Pocket PCs is the Jeode from Insignia Solutions, which I used on my Compaq iPaq for this review. Developers can use HIP PJ to implement a new and unique user interface for their Java applications (or applets). Each UI component can be arbitrarily shaped, with the mouse reacting correctly on it, and has a transparency property from 0 = opaque to 100 = fully transparent. Components can overlap; they can be dragged, and their visual appearance, including transparency, is automatically rendered accordingly. Skins can be defined, changed, and switched on the fly, making it easier to give applications the look you want. More than 80 classes, such as OWLButton, OWLDialog, OWLSlider, and OWLWindow, make up the powerful and flexible framework. The API is built and modeled after the AWT concepts and is easy to use.

HIP 1.0 J2
HIP 1.0 J2 is OWL's user interface framework that's compliant with the Java 2 specifications. It's written entirely in Java but built along the Swing technology that's included in Java 2. It brings the same feature set to the Java 2 platform as its PersonalJava counterpart, HIP 1.0 PJ. UI components can be transparent, draggable, and have true free-form shapes with the mouse reacting exactly to the defined shape. As with HIP PJ, skins can be defined, changed, and switched at runtime. The framework consists of over 60 classes, such as OWLJButton, OWLJMenuBar, OWLJSlider, and OWLJTextArea, that can be used to develop state-of-the-art user interfaces

Installing and Using HIP
Both HIP packages can be downloaded from OWL's Web site. HIP comes packaged as a JAR archive, thus it can be easily linked into any Java project. No additional configuration is necessary.

When a compiled project is run the first time, HIP asks for a license key and creates a license file that has to be stored beside the HIP JAR or in the system classpath. As long as HIP finds the license file in one of those two places, no further haggling with licenses is necessary. The license key mechanism is network-aware and will detect if the same key is used twice.

The included Read Me provides some basic information and pointers to the extensive API documentation on OWL's Web site. The documentation lives up to its task and provides a fully indexed and cross-linked Javadoc manual. If you have experience with AWT or Swing, soon you'll be using HIP like an expert. Starting with HIP, you'll notice that replacing Swing classes with their HIP counterparts usually works, speeding up your development time.

It would have been easier if OWL had included a default skin and some examples on how to use it to develop your own.

Sample Program Let's take a simple example and do some programming. The goal is to create a free-form crosshair that floats over the background (see Figure 1).

Figure 1

The task is simple. All you need are two graphics (JPEG or GIF), the picture of the crosshair (see Figure 2), a simple mask (see Figure 3), and some code for instantiation. Convenient multiparameter constructors or single methods for each representation can be used in both HIP frameworks. An example of the crosshair instantiation:

Figure 2 Figure 3

// HIP PJ code
crosshair = new OWLButton(crosshairBackground, null, null,
null, null, crosshairMask);

// HIP J2 code
crosshair = new OWLJButton();crosshair.setImage
crosshair.setMask (crosshairMask);

This is much easier than creating an optically similar result in Swing, and it would be a development project of its own in AWT. In HIP, everything is at your fingertips. As the mask can also contain gradients, any user interface design idea can be realized.

The HIP classes are accompanied by a rich set of methods and properties, making GUI development a lot easier. Next to the makeDraggable method are float value and percent setters for the transparency. In Figure 4, I've set the transparency value of an OWLJPanel to 40%, causing it (and all its children) to be rendered with a 40% transparency, so the parent component shines through the panel. The code is simple:

Figure 4


HIP J2 is worth using since transparencies and free-form shapes are a no-go in Swing; however, HIP PJ can bring these features even to PersonalJava. With HIP PJ you can develop advanced GUIs for communicators and handheld devices like a Compaq iPaq.

One thing that would make it even easier to start with HIP: additional ready-to-use code snippets. On the other hand, you can always go to OWL's online discussion boards for tips, tricks, and (free) support.

Our World Live's HIP is targeted at those who develop their user interfaces in Java. Its unique features and full-fledged API sets are impressive. Transparencies and free-form shapes are the way to go in user interfaces, but were difficult to achieve in Java until now. The API set is large and well thought-out. Everything has been modeled clearly and in accordance with the standard Java programming guidelines, so getting started is easy. The size of the frameworks is small, but be aware that your user interface graphics need space too. You can include your skin in your application or applet (which can get pretty big) or load it dynamically with a URL.

In addition to offering a whole new world of possibilities for GUI development, HIP can also reduce the time and cost for traditional user interface developments due to its rich set of methods and properties.

JDJ Product Snapshot

  • Target Audience: Java programmers, project leaders
  • Level: Beginner to advanced
  • Pros: Unique features, easy-to-use and powerful APIs
  • Cons: Nothing significant

    Our World Live, Inc.
    5901 Warner Ave. Suite 21
    Huntington Beach, CA 92649
    Phone: 714 840-5520
    E-Mail: [email protected]
    Web: www.ourworldlive.com

    HIP PJ: Any platform with PersonalJava 1.2 or JDK 1.1.8 support
    HIP J2: Any platform with Java 2 support
    Pricing: Development license starts at $1,695, deployment license starts at $20, and the ShareWare deployment license is $1.

    Test Platforms
    Sony VAIO FX150, 596MHz Intel Pentium III Processor, 20GB Disk, 128MB RAM, Windows XP v 2002 Compaq iPaq, 64MB RAM, PocketPC 2000

    Reviewed by:
    Matthew Dodd [email protected]

    All Rights Reserved
    Copyright ©  2004 SYS-CON Media, Inc.
      E-mail: [email protected]

    Java and Java-based marks are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and other countries. SYS-CON Publications, Inc. is independent of Sun Microsystems, Inc.