< Zurück | Inhalt | Weiter >

17.2.2 Using the Java 2 plug−in HTMLConverter

To get the same applet to run with Internet Explorer or Netscape, your HTML page must first be converted to use the Java 2 plug−in. The HTML conversion process will take your original <APPLET> tags and wrap them in a web−browser plug−in <OBJECT> tag. The original <APPLET> parameters will be passed to the plug−in instead of invoked directly on the applet.


At the time of writing the latest version of the plug−in is: Java 2 SDK, Standard Edition (J2SE), Version 1.3.0_01 which also supports Netscape 6.0.


The limitations of the plug−in tend to change quite quickly, here are some references:



http://java.sun.com/products/plugin/


http://java.sun.com/products/plugin/1.3/docs/tags.php


http://java.sun.com/products/plugin/1.3/converter.php


After you have installed the plug−in, you can invoke the HTML converter application and supply your original HTML file.


The output from the conversion process will produce a file similar to the following:


<html>

<head>

<title>SwingTestApplet − Daniel Selman</title>

</head>

<body>


<!−−"CONVERTED_APPLET"−−>

<!−− HTML CONVERTER −−>

<OBJECT classid="clsid:E19F9330−3110−11d4−991C−005004D3B3DB"

WIDTH = 760 HEIGHT = 390
codebase="http://java.sun.com/products/plugin/1.3.0_ 01/jinstall−130_01−win32.cab#Version=1,3,0,1">

<PARAM NAME = CODE VALUE = SwingTestApplet >


<PARAM NAME="type"

VALUE="application/x−java−applet;jpi−version=1.3.0_01">

<PARAM NAME="scriptable" VALUE="false">

<PARAM NAME = ARCHIVE VALUE = SwingTest.jar>

<PARAM NAME = "IMAGE_WIDTH" VALUE = "256">

<PARAM NAME = "IMAGE_HEIGHT" VALUE = "256">

<COMMENT>

<EMBED type="application/x−java−applet;jpi−version=1.3.0_01" CODE = Swing− TestApplet WIDTH = 760 HEIGHT = 390 ARCHIVE = SwingTest.jar IMAGE_WIDTH = "256" IMAGE_HEIGHT = "256" scriptable=false pluginspage="http:// java.sun.com/products/plugin/1.3.0_01/plugin−install.php"><NOEMBED>

<!−−"UNUSED PARAMETERS..."−−>

</NOEMBED>

</EMBED>

</COMMENT>

</OBJECT>


<!−−

<APPLET CODE = SwingTestApplet WIDTH = 760 HEIGHT = 390>

<PARAM NAME = ARCHIVE VALUE = SwingTest.jar>

<PARAM NAME = "IMAGE_WIDTH" VALUE = "256">

<PARAM NAME = "IMAGE_HEIGHT" VALUE = "256">

<!−−"UNUSED PARAMETERS..."−−>


</APPLET>

−−>


<!−−"END_CONVERTED_APPLET"−−>


</body>

</html>