Problem with JSObject
-
Hi, I have written a small code to access javascript function from a java applet. My function fails at this point JSObject win = JSObject.getWindow(this); I do not understand what is the reason.It gives me following errors when i excute the program : Exception in thread "main" java.lang.UnsatisfiedLinkError: initClass at netscape.javascript.JSObject.initClass(Native Method) at netscape.javascript.JSObject.<clinit>(JSObject.java:61) at test.InJava4.start(InJava4.java:52) at test.Main.main(Main.java:30) Please have a look at my code written below and tell me if i have written anything wrong.Please do help me out. Thnx. My java Applet code is written below : import java.net.*; import java.applet.*; import netscape.javascript.*; import netscape.javascript.JSException; public class InJava extends java.applet.Applet { public void init() { try { System.out.println("hi i am in appltet"); String msg = "Hello from Java (using javascript alert)"; JSObject win = JSObject.getWindow(this); win.call ("doAlert", null); } catch (Exception Ex) { System.out.println(Ex.toString()); } } public void start(){} public void stop(){} public void destroy(){} } My JavaScript is written below : ; function doAlert(s) { alert(s); }