Applet require some optional packages


Question: How can my applet require some optional packages (specific vendor and
versions)? (Java)

Answer: Since version 1.3 Java introduced support for an expanded set of Jar-file
manifest attributes.
The following portion of a sample manifest file illustrates the attributes that are
available for use by optional packages.
Extension-Name: javax.help
Specification-Vendor: Sun Microsystems, Inc
Specification-Version: 1.0
Implementation-Vendor-Id: com.sun
Implementation-Vendor: Sun Microsystems, Inc
Implementation-Version: 1.0
Note that all of the above manifest attributes should be included in an optional
package's manifest. If the plug-in looks for but doesn't find one of these attributes in
an optional package's manifest, it will assume that the optional package is not
suitable for the applet.

Note: Optional packages are the new name for what used to be known as standard
extensions. The "extension mechanism" is that functionality of the Java 2 SDK and
Java 2 Runtime Environment that supports the use of optional packages.
Optional packages are packages of Java classes (and any associated native code)
that application developers can use to extend the functionality of the core platform.
The extension mechanism allows the Java virtual machine (VM) to use the classes of the optional extension in much the same way as the VM uses classes in the Java 2
Platform. The extension mechanism also provides a way for needed optional
packages to be retrieved from specified URLs when they are not already installed in
the Java 2 SDK or Runtime Environment.
From SUN's description of the Java Extension Mechanism
è Good to know: Invoking modal popup dialogs from an applet's stop or destroy
methods is not recommended if you use Java 1.4.1 and below. Using modal popup
dialogs inside these methods could result in problematic behavior, including
NullPointerException, the dialog box not being displayed, the dialog box remaining
alive even after the applet was destroyed, or in the worst case, browser hang. This
problem has been fixed in 1.4.2.

Nhận xét

Bài đăng phổ biến từ blog này

What are restrictions for an applet