Top
Interstage Studio J Business Kit User's Guide
FUJITSU Software

2.2.3 How to Create an HTML File for JBK Plugin

This section describes how to create an HTML file for using JBK Plugin.

To execute an applet in a browser, a <APPLET> tag is used in an HTML file. To execute the applet in the browser with JBK Plugin, however, a tag for JBK Plugin is used instead of the <APPLET> tag. Create an HTML file for JBK Plugin, as described below.

For the method of specifying an applet with the <APPLET> tag, see a JDK document. For the attribute of the <APPLET> tag that can be used with JBK Plugin, see 'Supported Attributes in the <APPLET> Tag' below.

Creating an HTML file for Internet Explorer

To use JBK Plugin on Internet Explorer, create an HTML file for executing an applet, following these steps:

  1. Use the <OBJECT>...</OBJECT> tags instead of the <APPLET>...</APPLET> tags.

  2. Specify "CLSID:BEA62964-C40B-11D1-AACA-00A0C9216A67" as the CLASSID attribute of the <OBJECT> tag. With this setting, Internet Explorer automatically executes JBK Plugin.

  3. Code the following <PARAM> tag between the <OBJECT>...</OBJECT> tags.

    <PARAM NAME="TYPE" VALUE="application/x-JBK-Plugin">

  4. Code the following attributes that would be specified in the <APPLET> tag, directly into the <OBJECT> tag.

    • WIDTH, HEIGHT (required attributes)

    • ALIGN, HSPACE, VSPACE (optional attributes)

  5. Code the other attributes that would be specified in the <APPLET> tag between <OBJECT>...</OBJECT>, using the <PARAM> tag. Code this <PARAM> tag in this format: <PARAM NAME="attribute-name" VALUE="attribute-value">.

  6. Code the parameters to be passed to the applet (parameters that would be specified by the <PARAM> tag between <APPLET>...</APPLET>) directly between <OBJECT>...</OBJECT>.

The shortcut keys of a Web browser are disabled when an applet has the focus.

When [Ctrl]+[N] is pressed to open a new window from an Internet Explorer window that contains an applet, the new window may not accept shortcut keys because its applet has the focus.

To avoid focusing on the applet, specify the event handler onload="window.focus()" in the <BODY> tag. To inhibit focus movement by tab to the applet, specify the property "tabIndex=-1" in the <OBJECT> tag.

Example

Sample coding of an HTML file for Internet Explorer

To use JBK Plugin with Internet Explorer, the following coding of the <APPLET> tag is changed as shown.

  • Sample coding of the <APPLET> tag (when JBK Plugin is not used)

    <APPLET NAME="sample" CODE="Sample.class" ARCHIVE="sample.jar" WIDTH=100 HEIGHT=100>
      <PARAM NAME="color" VALUE="blue">
      <PARAM NAME="useDefault" VALUE="true">
    </APPLET>
  • Sample coding for using JBK Plugin (for Internet Explorer)

    <OBJECT CLASSID="CLSID:BEA62964-C40B-11D1-AACA-00A0C9216A67"
      WIDTH=100 HEIGHT=100>
      <PARAM NAME="TYPE" VALUE="application/x-JBK-Plugin">
      <PARAM NAME="NAME" VALUE="sample">
      <PARAM NAME="CODE" VALUE="Sample.class">
      <PARAM NAME="ARCHIVE" VALUE="sample.jar">
      <PARAM NAME="color" VALUE="blue">
      <PARAM NAME="useDefault" VALUE="true">
    </OBJECT>

Using Hidden Applets

There are two methods to hide the <object> element in HTML.

Method 1

Use width=0,height=0 to create an object Tag.

In this case, the window disappears, but sometimes the window can get focus when the applet starts, and sometimes the focus can be set on the applet by Tab switch(Tab pressing) on HTML.

Therefore, please specify the "tabindex=-1" in the object, to prevent the focus from moving to the window.

Method 2

Prepare a <div>Tab that includes an <object>Tab and set its display style as hidden (display=none or visibility=hidden).

Note that JBK Plugin's control cannot be created and the applet cannot be started if the display style is hidden at the beginning. Therefore, make the display style visible when creating it, and set it to hidden after creation.

Note

Sometimes the applet cannot be started if the applet is hidden at startup.

The Applet cannot be started under the following conditions.

  • The <object>Tab is inserted through the script; and

  • The display style is set to hidden in the same event handler.

The JBK Plugin creates an applet after the window size is confirmed. However, under the above conditions, the applet is hidden before the object's window size is notified, which leads to a failure in starting the creation of the applet's child window. In this case, to set the display style as hidden, use the setTimeout() function of script as the next event.

Supported Attributes in the <APPLET> Tag

For JBK Plugin, you can use the following attributes of the <APPLET> tag.

Note

Uppercase and lowercase letters in attribute names and parameter names

  • When coding the attributes of the <APPLET> tag described above in an HTML file for JBK Plugin, the attribute names can be coded in uppercase or lowercase in the <APPLET> tag. For instance, the attribute name for specifying an applet class name can be "CODE" or "code."

  • When an applet is executed with JBK Plugin, the parameter names passed to the applet are case-insensitive.

Point

Compatibility with an HTML file for Java Plug-in

An HTML file for JBK Plugin has compatibility with that for Java Plug-in of Oracle Corporation, however, except a few differences. An HTML file for using Java Plug-in can be used with JBK Plugin after the following changes were made:

  • Change the CLASSID attribute of the <OBJECT> tag coded in the HTML file for using Java Plug-in to "CLSID:BEA62964-C40B-11D1-AACA-00A0C9216A67."

  • If the <OBJECT> tag contains the coding of the CODEBASE attribute as shown below, eliminate the coding.

    codebase="plugin-download-URL"

    "plugin-download-URL" specifies the URL from which Java Plug-in can be downloaded. For Java Plug-in 1.5.0, as an example, "plugin-download-URL" specifies the following URL (which may be changed when Java Plug-in is upgraded).

    http://java.sun.com/update/1.5.0/jinstall-1_5_0-windows-i586.cab#Version=1,5,0,0

  • Check whether the <PARAM> tag is coded as shown below between the <OBJECT>...</OBJECT> tags.

    <PARAM NAME="type" VALUE="plugin-type-information">

    As "plugin-type-information," the type information used internally by Java Plug-in is coded. The followings are the examples of the type names. (The type names may change when Java Plug-in is upgraded.)

    1. application/x-java-applet

    2. application/x-java-applet;version=nnn

    3. application/x-java-bean

    4. application/x-java-bean;version=nnn

      ('nnn' is a version number of Java Plug-in.)

    If the tag is coded, replace the <PARAM> tag with the following coding. If the tag is not coded, add the <PARAM> tag as shown above between the <OBJECT>...</OBJECT> tags.

    <PARAM NAME="TYPE" VALUE="application/x-JBK-Plugin">