FileDocCategorySizeDatePackage
HelloWeb2.javaAPI DocExample632Sat Apr 04 02:58:18 BST 1998None

HelloWeb2.java

/*
	Note: you'll need a Java 1.1 enabled browser for this example.
*/

import java.applet.Applet;
import java.awt.*;
import java.awt.event.*;

public class HelloWeb2 extends Applet implements MouseMotionListener {
	int messageX = 125, messageY = 95;  
	String theMessage;
	
	public void init() {
		theMessage = getParameter("message");

		addMouseMotionListener(this);
	}
	
	public void paint( Graphics graphics ) {
		graphics.drawString( theMessage, messageX, messageY );
	}

	public void mouseDragged( MouseEvent e ) {
		messageX = e.getX(); 
		messageY = e.getY();
		repaint();
	}

	public void mouseMoved( MouseEvent e ) { }
}