import java.applet.*; import java.awt.*; public class Scribble extends Applet { private int last_x = 0; private int last_y = 0; // Called when the user clicks public boolean mouseDown(Event e, int x, int y) { last_x = x; last_y = y; return true; } // Called when the mouse moves with the button down public boolean mouseDrag(Event e, int x, int y) { Graphics g = getGraphics(); g.drawLine(last_x,last_y,x,y); last_x = x; last_y = y; return true; } }