I did this a long time ago, but the bottom line is that you want to extract the DLL from your applet code base in order to save it in the JAR, and then you want to copy it to the / lib / ext JRE folder.
//Where this is an applet URL codeBase= this.getCodeBase(); URL twainUrl new URL(codeBase, "jtwain.dll"); String javaHome=System.getProperty("java.home"); //copy the contents of twainUrl to javaHome\lib\ext
You need your applet to be signed.
source share