为什么getWindow()不能得到解决?(Why is getWindow() not able

2019-07-03 17:17发布

我无法解决getWindow(); 方法出于某种原因...

import java.applet.Applet;

import netscape.javascript.JSObject;

public class Class466 {
public static void method6020(Applet applet, String string, int i)
        throws Throwable {
    try {
        JSObject.getWindow(applet).eval(string);
    } catch (RuntimeException runtimeexception) {
        throw Class346.method4175(runtimeexception, new StringBuilder()
                .append("tf.a(").append(')').toString());
    }
}

public static Object method6021(Applet applet, String string, short i)
        throws Throwable {
    try {
        return JSObject.getWindow(applet).call(string, null);
    } catch (RuntimeException runtimeexception) {
        throw Class346.method4175(runtimeexception, new StringBuilder()
                .append("tf.f(").append(')').toString());
    }
}

public static Object method6022(Applet applet, String string,
        Object[] objects, byte i) throws Throwable {
    try {
        return JSObject.getWindow(applet).call(string, objects);
    } catch (RuntimeException runtimeexception) {
        throw Class346.method4175(runtimeexception, new StringBuilder()
                .append("tf.b(").append(')').toString());
    }
}

Class466() throws Throwable {
    throw new Error();
}
}

Answer 1:

在jdk1.7.0_11我注意到,有包含../jre/lib/内两个独立的罐子netscape.javascript.JSObject.class ,即jfxrt.jar和plugin.jar。 在我的IDE(的IntelliJ)的情况下,当我创建了一个项目SDK的Java它增加了两个jfxrt和插件jar添加到类路径中。 由于jfxrt.jar之前plugin.jar在classpath中按字母顺序出现,我的应用程序代码并没有解决JSObject.getWindow(...)正确。 由于我们没有我们的应用程序中使用JavaFX我只是从我的项目的Java SDK类路径中删除jfxrt.jar。



Answer 2:

是“MAYSCRIPT” Applet标记参数中声明?

<APPLET code="XYZApp.class" codebase="html/" align="baseline"
 width="200" height="200" MAYSCRIPT>



Answer 3:

我认为你必须添加:

import java.awt.Window;
import java.awt.event.WindowEvent


文章来源: Why is getWindow() not able to be resolved?