Applets are Java programs embedded into web pages, allowing most of the functionality of a Java application but removing the need for separate downloading and installation. They user can interact with applets and pass responses back to process on the web server such as databases. They perform a similar role to flash pages except they come with some advantages (and disadvantages) by comparison. Flash has the advantage that it is especially suitable for creating animated images, and a user can do that with almost no knowledge of programming. As flash has developed programming features have been added. Java has the advantage of being an industrial strength programming language that was designed from the ground up for software engineering. It also has more support for encryption and security than any alternative technology.

In the early days of the web many people thought that most web pages would involve Java applets, but much of the anticipated role has been taken up by Javascript (almost no relation to Java). There are still some tasks for which only a Java Applet will fully solve the problem. One of the benefits of applets is that once they are downloaded you do not have the performance benefit of server side applications where you are relying on a round trip to the server for each interaction, though of course JavaScript is frequently a more “lightweight” alternative for browser based interactivity.

You can see how complex an applet can be by running the applet embedded in the SwingSet2.htm file that gets installed with the JDK. With my installation of the JDK this was installed at

file:///C:/Program Files/Java/jdk1.5.0/demo/jfc/SwingApplet/SwingApplet.html

Yours may be slightly different, but it will probably be found under the demo/jfc directory of your JDK installation.

Last modified: Thursday, 24 July 2014, 2:54 PM