The following example will illustrate how to use JavaScript to change the Applet status and call the applet in JavaScript.
I. Applet source code (TMIN_JS2.java) // Importimport java.awt.graphics; import java.awt.event; // limited ... for javascript // not buy ... (it's more simple) public class te_js2 extends Java.applet.applet {// variablesstring str; // sample string ... int i; // nb change ... // initialisation de l'appletpublic void init () {// method init () str = new string ("TEST"); i = 0;} // debign l'AppleTPublic Void Paint (Graphics G) {// Methode Paint () g.drawstring (STR, 5, 10);} // setstring: Change string value public Void setString (String s) {str = new string (s); i ; // forward repaint to see change;} // getString: Get string value public string getString () {return str;} // getVal : Get Number of Change Public Int getVal () {Return i;}} II. Note (1) In Applet, you want to name: