In part one of this series, we looked at five free or nearly-free Java HTML renderers, evaluating them in terms of support for modern standards (XHTML and
CSS1/CSS2 support), support for legacy pages, hackability, and speed. In this second
part, we turn our attention to commercial products. We still have the same
requirements: the code must be callable from Java (meaning the product is either
100 percent Java or a Java wrapper to native code), and the package must show some
amount of recent activity.
We evaluated each against a control: a recent build of Mozilla Firebird, running on Windows. Its handling
of the front pages of Amazon, Slashdot, and the CSS Zen Garden are shown in part one. Also see part one for a discussion of why these sites were used as the controls.
This 100-percent-Java web browser comes in two versions, one for Swing and one
for AWT (mainly for support of older JDKs). It provides basic
customization and access to the underlying document tree. JavaScript support is
provided via Rhino, Mozilla's JavaScript-in-Java project, and it has built-in support for searching and printing. It
doesn't look too hackable in terms of messing with the internals, but there
are a lot of callbacks for different events.
The renderer is quite fast, and it has a nifty zooming feature that scales both text and images. It handled Amazon and Slashdot (see Figures 4 and 5) very well, but choked on most of the CSS Zen Garden (as you can see in Figure 6). The speed for Hamlet was almost as fast as a native browser. For a Java browser, it's quite good. I would recommend it for anything that doesn't require advanced CSS. Hopefully they will continue to update it in the future.
Figure 4. Amazon in WebWindow (You can click on the screen shot to open a full-size view.)
Figure 5. Slashdot in WebWindow (You can click on the screen shot to open a full-size view.)
Figure 6. CSS Zen Garden in WebWindow (You can click on the screen shot to open a full-size view.)
Modern Compliance: Weak Legacy Web: Good JavaScript: Yes (via Rhino) Hackability: Decent Speed: Good
The Clue Web Browser is a completely Java-based browser designed
primarily for the device (PDA and set-top box) space, though their desktop
version runs quite well. My tests show it to be quite speedy, and it renders
standard web sites very well, almost identically to Netscape and IE. They
sell several versions, from Basic to the X-Edition, which includes advanced
XML, XSLT, and XHTML. Support for JMF and SVG (with extra plugins) is also
nice. They claim to support CSS2, but when I brought up the Zen Garden, it
only showed the default layout with no style. This may be an artifact of
the way the Zen Garden degrades to older browsers, which probably wouldn't
be an issue in a custom application.
On the hackability scale, Clue provides callbacks for virtually every
event and has an API for writing plugins and new scripting languages. Net Clue
has also implemented direct DOM access, allowing developers to generate and
manipulate content entirely from within Java. JavaScript 1.5 support is
provided by Rhino.
All in all, I would say that Clue is a quality commercial implementation.
My only wish is for greater support of forward-looking layouts with complete
CSS2 support.
Figures 7, 8, and 9 show NetClue's rendering of our control sites.
Figure 7. Amazon in NetClue (You can click on the screen shot to open a full-size view.)
Figure 8. Slashdot in NetClue (You can click on the screen shot to open a full-size view.)
Figure 9. CSS Zen Garden in NetClue (You can click on the screen shot to open a full-size view.)
WebRenderer is a wrapper library from Jade Liquid Software. They support
Windows, Mac OS X, Linux, Solaris, and the Java Desktop System. The wrapper can launch
the real browser internally and gives the developer access to virtually
any kind of event you can imagine. There is a slew of preferences to
control the browser, but since it's really Mozilla or IE underneath, you
can't extend it very much. For preview applications, however, this
should be fine, and I found it quite easy to create a demo program.
Figures 10, 11, and 12 show our test pages as handled by WebRenderer.
Figure 10. Amazon in WebRenderer (You can click on the screen shot to open a full-size view.)
Figure 11. Slashdot in WebRenderer (You can click on the screen shot to open a full-size view.)
Figure 12. CSS Zen Garden in WebRenderer (You can click on the screen shot to open a full-size view.)