不能在一个Java小程序的项目来解决JSObject [英] Not able to resolve JSObject in a java applet project

查看:133
本文介绍了不能在一个Java小程序的项目来解决JSObject的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想打电话给 JSObject.getWindow(本)的init 的方法 JApplet的,但它不能够解决符号 getWindow

I am trying to call JSObject.getWindow(this) in the init method of JApplet but it is not able to resolve the symbol getWindow.

这个问题专门通过NetBeans中创建一个JavaFX应用程序项目发生的,如果在一个Java应用程序项目中使用的getWindow是越来越得到解决。

this problem is specifically happening with a javafx application project created through netbeans , getWindow is getting resolved if used in a java application project.

我也包括了 plugin.jar 从路径的Java \\ jdk1.7.0_07 \\ JRE \\ lib中

这是我在NetBeans中创建一个JavaFX应用程序项目。

This is a javafx application project that I created in netbeans.

推荐答案

这样做的原因是,jfxrt.lib也有一个叫JSObject类。这JSObject没有getWindow功能的定义,同时plugin.jar一个人。如果更改JAR的依赖秩序,使Java解决JSObject到plugin.jar那么Java能够调用getWindow功能。

The reason for this is that jfxrt.lib also has a class named JSObject. This JSObject does not have getWindow function defined while plugin.jar one has. If you change the dependency order of JAR and make java to resolve JSObject to plugin.jar then java is able to call getWindow function.

以下是链接到两个的jfxrt一个不具备getWindow定义的classes.Note的的javadoc。

Following are the links to the javadocs of both the classes.Note that jfxrt one doesn't have getWindow defined.

<一个href=\"http://docs.oracle.com/javafx/2/api/netscape/javascript/JSObject.html\">http://docs.oracle.com/javafx/2/api/netscape/javascript/JSObject.html

<一个href=\"http://www.oracle.com/webfolder/technetwork/java/plugin2/liveconnect/jsobject-javadoc/netscape/javascript/JSObject.html\">http://www.oracle.com/webfolder/technetwork/java/plugin2/liveconnect/jsobject-javadoc/netscape/javascript/JSObject.html

这篇关于不能在一个Java小程序的项目来解决JSObject的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆