/*ch0706.java*/
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ch0706 extends JApplet
{ int x1,y1,x2,y2;
  public void init()
  { addMouseListener(new MouseAdapter()
    { public void mousePressed(MouseEvent e)
      { x1=e.getX();
        y1=e.getY();
      }
    });
    addMouseMotionListener(new MouseMotionAdapter()
    { public void mouseDragged(MouseEvent e)
      { x2=e.getX();
        y2=e.getY();
        repaint();
      }
    });
  }
  public void paint(Graphics g)
  { g.drawLine(x1,y1,x2,y2);
  }
}



