import java.applet.*; import java.awt.*; |
import netscape.javascript.JSObject; |
public class SayThanks extends Applet { |
JSObject win; |
String str = "Click for an important message"; |
int x = 25; int y = 25; |
public void paint ( Graphics g ) { |
g.drawString ( str, x, y );} |
public void init() |
{ win = JSObject.getWindow(this);} |
public boolean mouseUp(Event e, int x, int y) |
{ JSObject document = |
(JSObject) win.getMember ( "document" ); |
Object args[] = new Object[1]; |
String title = |
(String) document.getMember ( "title" ); |
args[0] = "Thanks for visiting " + title; |
win.call ( "alert", args ); |
return true; |
} |