FileDocCategorySizeDatePackage
Scribble.javaAPI DocExample1145Mon May 19 18:23:14 BST 1997None

Scribble

public class Scribble extends Applet

Fields Summary
private int
last_x
private int
last_y
Constructors Summary
Methods Summary
public booleanmouseDown(java.awt.Event e, int x, int y)

  // Fields to store a point in.

  // Called when the user clicks.
          
    last_x = x; last_y = y;            // Remember the location of the click.
    return true;
  
public booleanmouseDrag(java.awt.Event e, int x, int y)

    Graphics g = getGraphics();        // Get a Graphics to draw with.
    g.drawLine(last_x, last_y, x, y);  // Draw a line from last point to this.
    last_x = x; last_y = y;            // And update the saved location.
    return true;