// Importations
import java.awt.Graphics ;
import java.awt.Event ;
// LiveConnect... for JavaScript
import netscape.javascript.JSObject ;
public class tmin_JS extends java.applet.Applet {
// Variables
// Initialisation de l'applet
public void init() { // Methode init()
}
// Dessiner l'applet
public void paint(Graphics g) { // Methode paint()
g.drawString("Click here...", 5, 10) ;
}
// Mouse down
public boolean mouseDown(Event e, int x, int y) {
try { // create JSObject
JSObject.getWindow (this).eval ("javascript:alert('tmin_JS click " +
" x=" + x + " y=" + y + "')") ;
}
catch (Exception ex) { // Error on create JSObject
showStatus( "Error call javascript err=" + ex );
}
return true ;
}
}
|