import java.awt.*; import java.applet.*; public class Sovelma2 extends Applet { private int lastx, lasty; private Color vari = Color.blue; public void init() { } public boolean mouseDown (Event e, int x, int y ) { lastx=x; lasty=y; return true; } public boolean mouseDrag (Event e, int x, int y ) { Graphics g = this.getGraphics(); g.setColor(vari); g.drawLine(lastx, lasty, x, y); lastx=x; lasty=y; return true; } }