Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Not able to resolve JSObject in a java applet project [duplicate]

I am trying to call JSObject.getWindow(this) in the init method of JApplet but it is not able to resolve the symbol 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.

I have also included the plugin.jar from path Java\jdk1.7.0_07\jre\lib.

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

like image 322
deovrat singh Avatar asked Dec 19 '12 13:12

deovrat singh


1 Answers

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.

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

http://docs.oracle.com/javafx/2/api/netscape/javascript/JSObject.html

http://www.oracle.com/webfolder/technetwork/java/plugin2/liveconnect/jsobject-javadoc/netscape/javascript/JSObject.html

like image 95
deovrat singh Avatar answered Nov 03 '22 12:11

deovrat singh