网上搜到一个解决swt browser显示applet要报错的方法。看了半天对他的过程不大理解,希望大家帮我参谋参谋。
内容如下:
A somewhat complex way to fix this problem is to write a wrapper Launcher
program in C/C++ that delegates the job of initializing the JVM to the embedded
browser (in this case IE).Instead of directly creating a JVM in using JNI the Launcher would first
initialize its emedded browser (IE) via COM and have the browser intialize its
own JVM. it would accomplish this by launching a local HTML splashscreen, that
contains an APPLET tag pointing to a local codebase. (ie. launch a splashscreen
with a local document rather than requiring a live IP connection to the outside
world)The Launcher program would wait until the splashscreen had been displayed and
then connect to in-process JVM that was created by the browser. ie. it would
call GetCreateJavaVM to obtain a handle to the JVM created by the browser, then
proceed to launch the SWT app within this JVM.
(具体链接是https://bugs.eclipse.org/bugs/show_bug.cgi?id=59506)他让用com写一个launcher来启动jvm。是不是在new一个browser之后马上调用这个launcher来启动IE,然后IE中的jvm也跟着启动。当执行applet程序的时候,就用这个jvm来运行,而不另外启动。
请大家帮我分析分析,我对这个不是很熟悉。谢谢!