Java Applets & Web Applications

by July 10, 2005

Whenever I give my Web Application Solutions talk, I preface the section about using Java applets to develop the front-end interface of Web apps with “believe it or not there are good reasons to do this…” My primary motivation is that Java in the Web browser still carries negative connotations for most Web designers and developers.

“Many of us have been so bombarded with bad press on client-side Java that advising anything other than an HTML-based front end would be like digging your own grave.” –Java World

Like Macromedia Flash’s infamous “Skip Intro” animations and overzealous redesign of basic interface components, Java applets (a restricted form of Java application that is downloaded to and run within a Web browser) were frequently employed for gratuitous, resource-hogging (often leading to browser or OS crashes), and download-heavy animated navigation systems. These navigation applets were often better off as simple HTML which enabled: faster downloads; consistency with the Web page model (bookmark and back button compatibility); and less interaction “clutter” (animation, images, etc.).

Java applets also faced significant technical hurdles in the shape of varying Java Virtual Machines (JVM) -which are required to run applets- and inconsistencies in how different Web browsers implemented Java.

That said there are compelling reasons for using Java on the front-end. Web applications that require processor intensive visualization rendering and real-time data updates might be well served with a Java applet. Interactive, dynamically generated graphs and/or streaming data are a natural fit for front end Java as a number of recent examples have shown:

  • The Secret Lives of Numbers This interactive system invites you to explore how the usage patterns of numbers reflect our culture, history, and biology. The data shown represents the “popularity” of every integer between 0 and 1000000, collected periodically since 1997 from a popular search engine…
  • NameVoyager The Baby Name Wizard's NameVoyager is an interactive portrait of America's name choices. Type a letter, and you'll zoom in to focus on how that initial has been used over the past century…
  • Texone Tree Tree accesses the source code of a web domain through its url and transforms the syntactic structure of the web site into a tree structure represented by an image. This image illustrates a tree with trunk, branches and ramifications.

Also, Sun’s Java Plugin (now available for most browsers) removed the dependency on a Web browser’s JVM and once installed allows an applet to be downloaded and cached, which means reloading an HTML page with the same applet is almost instantaneous. The biggest disadvantage of the Java Plugin, however, is that it requires an initial 5MB download. This may be acceptable in a controlled user environment (intranet, paid Web application release, etc.) but could be a roadblock for a commercial Web application.