/* * @(#)Applet03.java 1.0 01/11/29 * * You can modify the template of this file in the * directory ..\JCreator\Templates\Template_2\Project_Name.java * * You can also create your own project template by making a new * folder in the directory ..\JCreator\Template\. Use the other * templates as examples. * */ import java.awt.*; import java.applet.*; public class Applet03 extends Applet { int a,b,c,d; boolean eka=true; public void init() { } public void paint(Graphics g) { g.drawLine(a,b,c,d); a=c; b=d; } public boolean mouseDrag (Event e, int x, int y) { if(eka) { a=x; b=y; eka=false; } else { c=x; d=y; eka=true; //repaint(); } return true; } }