Skip to content Skip to sidebar Skip to footer

Javascript To Java Applet - Working

This is a continuation of my original post here: javascript-to-java-applet-using-deployjava-js-to-run-commandline I am pretty new to Java. I want to create a Java Applet that will

Solution 1:

you do not need to make a new instance of the applet every time, using the mayscript tag for applet you can tell the browser to allow java script to applet communication.

Also you should clean up the init method

<head><scripttype="text/javascript">//whatToDo can be from an input box//in applet check if its del or rmdir or move or delete at a minimumfunctioncallJavaCmd (whatToDo) {
                // call the MessageBox method of the appletvar applet = document.getElementById ("myApplet");
            applet.command (whatToDo);
        }

    </script></head><body><appletid="myApplet"code="Your.class"codebase="/base/"mayscript="mayscript"style="width:300px; height:50px;"></applet>

Ref http://help.dottoro.com/lhbkaqko.php and http://docs.oracle.com/javase/6/docs/technotes/guides/plugin/developer_guide/java_js.html The old netscape classes are part of every JVM (netscape.javascript.)

Post a Comment for "Javascript To Java Applet - Working"