it is the same as application, you just have to get security permission to use JNI

解决方案 »

  1.   

    first use applet download the c library to client side(you need local file write permissiont here), then load it, then call native method as in application.
      

  2.   

    at client side:
    modify java.policy file(usually under jre folder typically C:\Program Files\JavaSoft\JRE\1.4\lib\security).for each jar file used by your applet, add a line similar to the following to the java.policy filegrant codeBase "http://123.123.123.123/test/test.jar" {
      permission java.security.AllPermission;
    };
    in your applet program, eg applet.init()
    download jni eg aa.dll to c:\tmp\aa.dll
    then you can load the dll from c:\tmp\aa.dll