Summary
Improved support for applets is one way Sun's Java Update 10 promises to make client-side Java developers' lives easier. Geertjan Wielenga draws attention to key new applet-related JRE features, and ponders what they may mean for the future of applets.
Advertisement
Sun's recently released preview of Java 6 Update 10 has promised to make client-side developers' lives easier by solving many challenges associated with deploying a proper JDK to clients. A key way in which Update 10 achieves that is a tighter integration of Sun's Java Network Launching Protocol and the traditional applet deployment model.
In a recent blog post, Applets Reloaded: An Overview of New Tags and Demos
, NetBeans core developer Geertjan Wielenga points to some of the key new applet-related JRE features, noting that they only work on Windows under IE 7 and FireFox 3, but that on those platforms, the new features are impressive:
I created a small applet, added some Swing components, and deployed it via a JNLP file. First I deployed it to FireFox 2 and got the same old terrible performance. Deployed to FireFox 3, it was a breeze. There's some kind of very gentle introduction of the applet to the browser whereby it seems to unfold before your eyes as it is deployed to the page. A very nice professional effect.
Notable applet-related features described in the Java Update 10 release notes include:
Improved reliability.
The JVM running the applet is isolated from the web browser at the operating system level. If something should go wrong while running the applet, or if an uncooperative applet refuses to shut down, the new Java Plug-In detects and handles the error condition gracefully; the web browser is unaffected.
Built-in JNLP support.
The new plug-in offers the capability to launch applets directly from JNLP files, unifying deployment of Java content both in the browser and out of the browser (via Java Web Start).... Applets can now access JNLP APIs for persistent data storage, local file system access, and other useful functionality from sandboxed code.
Per-applet command-line arguments.
JVM command-line arguments may be specified on a per-applet basis, providing fine-grained control over options such as the heap size and Java 2D hardware acceleration features. JNLP-launched applets simply incorporate the command-line arguments and/or system properties into the JNLP file...
Multiple JRE version support. Each individual applet instance may request a different JRE version on which to run. This feature is designed for enterprise customers which prefer to qualify their applets against either a particular JRE version or a particular JRE family...
Improved Java/JavaScript communication.
The bridge between the JavaScript engine in the web browser and the Java programming language has been completely reimplemented... for both Java calling JavaScript as well as JavaScript calling Java. Formerly Mozilla-specific "LiveConnect" functionality, such as the ability to call static Java methods, instantiate new Java objects and reference third-party packages from JavaScript, is now available in all browsers...
Improved user experience.
The new Java Plug-In starts applets in the background, so the web browser always remains responsive. Applets appear on the web page as they become ready to run.
Improved applet lifecycle management.
Calls to the applet lifecycle methods init(), start(), stop(), and destroy() are more deterministic and cross-browser behavior has been improved. The applet class loader cache and the legacy applet lifecycle... are fully supported and the behavior of both has been improved.
Better large heap support.
Historically, the maximum heap size that could be specified for applets via the Java Control Panel has been limited. This limitation is fixed in the new Java Plug-In; applets can now utilize as much heap space as command-line applications.
Better Windows Vista support.
Signed applets running in Protected Mode Internet Explorer on Microsoft's Windows Vista now have the same privileges as normal user applications, eliminating a portability barrier to this platform.
Do you think these new applet-related features will make applets a more viable deployment mechanism?
I'm waiting what JFX will be like with support of these new deployment features and how it will influence the ability to simply drag and drop applet to your desktop and make it a standalone application.
I'd not put it like that. Sun made a mistake with leaving us without good support for developing webapps and deploying them in this area of the platform, that's right. Anyway, I think belated is better than never. Adobe's set a high standard but still has some catches. Let's see why Chet Haase joined Adobe ;)
Sun will never be able to make applets good enough to compete with Silverlight and Flash. It's a timing and perception issue. Sun could've owned the RIA market and failed it.
Sun will never be able to make applets good enough to compete with Silverlight and Flash. It's a timing and perception issue. Sun could've owned the RIA market and failed it.