A Complete Guide to Web Design

(やまだぃちぅ) #1
Java Applets 371

Interactivity

Java Applets

Web Design in a Nutshell, eMatter Edition

Java’s primary contribution to the Web, however, has been in the form of Java
applets, self-contained mini-executable programs. These programs, named with the
.class suffix, can be placed right on the web page, like a graphic.


Advantages and Disadvantages


Applets are ideal for web distribution for the following reasons:



  • They are platform-independent.

  • They download completely and run on the client-side, so there is no contin-
    ued burden on the server.

  • Applet files are generally quite compact and download quickly.

  • They don’t require a proprietary plug-in to be installed. All the major brows-
    ers are now Java-enabled, which means chances are good that users will be
    able to view the applet.


Of course, every utopian technology has its darker side, and unfortunately, in the
real world, browsers can be temperamental in the way they handle Java applets.
Browsers are notorious for crashing in the presence of a computation-hungry
applet. In general, it takses browsers a long time to initialize Java, which tends to
chase users away. There was a great buzz amongst web developers when Java
applets first hit the scene, but since then enthusiasm has waned in the face of
performance issues and the development of other web multimedia solutions.


What Applets Can Do


Whatcan’tapplets do?! Java applets are used for everything from simple anima-
tions to flight simulators. Because Java allows for computations on-the-fly, they are
useful for programs that interact with user input. Not surprisingly, a large
percentage of Java applets are games, but applets are also used for more practical
purposes, such as calculators and spreadsheets. More interestingly, they can serve
live data (news headlines, stock quotes, sports scores, etc.) and let users navigate
through complex data relationships.


There are probably thousands of Java applets out there. The following is just a
smattering of the types of things they can do:



  • Utilities—calculators, calendars. clocks, spreadsheets, etc.

  • Text effects—scrolling marquees, wiggling text, flashing colored text mes-
    sages, etc.

  • Audio effects —digital “guitars,” radio buttons, etc.

  • Games—Asteroids, crosswords, Hangman, Minesweeper, etc.

  • Miscellaneous — biorhythm charts, flight simulators, daily quotes, etc.


Where to Get Applets


If you need a customized applet for your site, your best bet is to hire a
programmer to create one to your specifications. However there are a number of

Free download pdf