Page 3 of 3
A Java Applet is written in Java and run in a plug-in withing the browser. Its advantages are obvious - you can program in Java another full language with features and facilities go well beyond a scripting language. In other words, you can use the same technology on the desktop or server as you do on the web page. You can also create and debug applets in the same IDE as you develop desktop applications. Trusted (signed) applets can gain access to the users machine on the same level as a desktop application.
The disadvantages are also obvious but seem fairly trivial. Applets need a browser plug-in and the Java JRE to be installed.
Java applets can make use of 3D graphics, including hardware acceleration, and provide most of the advanced features needed to create rich web applications. One of the big mysteries is why Java applets have fallen out of favor. Part of the reason is probably the success of Flash and another part is that while the developer tools are good, tools aimed at the designer are no-existent. There is also the historical matter of the conflict between Sun and Microsoft that made it difficult for Windows and IE users to download or even locate the correct JRE. Even today you cannot assume that the average user has everything installed need to run an applet and the procedure to upgrade isn't particularly simple. There is also the small matter that the UI framework in use at the time, AWT, didn't look good and even today the Swing framework isn't regarded as cutting edge.
As a result of all of these pressures and failings Java applets are today not dead but not a hot technology either. This may be a missed opportunity as Java 6 has made applets much easier for the end user with its next generation Java Plug-in https://jdk6.dev.java.net/plugin2. This runs the applet in its own JVM outside of the browser and so doesn't rely on browser support.
Java applets are a technology that deserves a second, or is it third or fourth, look.
The final technology that we are going to examine can be considered to be a development on the Java applet and it might just revitalise it.
JavaFX solves many of the perceived problems in Java applets. It provides designer plug-ins for PhotoShop and Illustrator allowing animations to be created without having to write code. It offers a new and extended UI framework which extends Swing. It allows applications to be installed out-of-browser by simply dragging and dropping onto the desktop. In addition it also has a good development environment in the form of NetBeans or a plug-in for Eclipse. It also originally targeted mobile and embedded platforms as well as web apps and desktop apps.
The big problem with JavaFX is its use of a scripting language - JavaFX Script. This was a cut-down language suitable for client side scripting and from most programmers point of view an unnecessary complication. Why invent another language to do the job when you already have full Java. This seems to be the point of view of Oracle as the next version of JavaFX will not have JavaFX scripting language included and all of the work will be done via Java APIs. Of course the problem with this sensible solution is that it leaves current JavaFX early adopters high and dry. In addition it no longer becomes sensible to try JavaFX until version 2 is available sometime in the second half of 2011, which is a very long hiatus in the development of a system. You also have to take into consideration the fact that Oracle has stopped work on mobile versions of JavaFX which makes it considerably less attractive.
However, if one were to return to JavaFX in late 2011 and there were still not a single obvious answer to the question of which web development system to use it might still have a chance to revamp the Java applet. But until such time it looks to be dead in the water.
Is there a better way?
At this point we could cover alternative development systems. Worthy of mention are OpenLaszlo and XUL, but none of the alternatives have made sufficient inroads or gained enough of a following or support to be taken seriously alongside the technologies described above. It might just be that there is a technology waiting to take the stage and win the game, or it might be that a completely new idea is needed.