通过和Javascript的交互可以做到!

解决方案 »

  1.   

    HOW JAVA TO JAVASCRIPT COMMUNICATION WORKS IN JAVA PLUG-IN 
    http://java.sun.com/products/plugin/1.3/docs/jsobject.html
      

  2.   

    //Applet code
    import netscape.javascript.*;
    import java.applet.*;
    import java.awt.*;
    public class MyApplet extends Applet {
         public void init() {
             JSObject win = JSObject.getWindow(this);
             JSObject doc = (JSObject) win.getMember("document");
             doc.eval("test1.value='Text value set by applet';");
         }
    }
      

  3.   

    <html>
    <body >
    <p>
    <OBJECT classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93"
         width="200" height="200" align="baseline"
         codebase="http://java.sun.com/products/plugin/1.3/jinstall-13-win32.cab#Version=1,3,0,0">
         <PARAM NAME="code" VALUE="MyApplet.class">
         <PARAM NAME="type" VALUE="application/x-java-applet;version=1.3">
        <PARAM NAME="MAYSCRIPT" VALUE="true">
    </OBJECT>
    </p>
    <input type=text id="test1" name = "test1" value="testsss">
    </BODY>
    </html>
      

  4.   

    Download this file, 
    ftp://ftp.netscape.com/pub/sdk/plugin/windows/oct_21_97/winNPSDK.zip
    upzip it, then you get netscape.*(classes needed by the applet) under the folder:
    \winsdk40\classes\java_30\netscape