import java.awt.*; import java.awt.event.*; public class Pendel extends Frame implements MouseMotionListener{ public Pendel(){ setSize(300, 300); setVisible(true); addMouseMotionListener(this); } public void mouseMoved(MouseEvent e){} public void mouseDragged(MouseEvent e){ Graphics g=this.getGraphics(); g.setColor(Color.yellow); g.fillRect(0, 0, getSize().width, getSize().height); g.setColor(Color.black); g.drawOval(e.getX(), e.getY(), 10, 10); g.drawLine(e.getX(), e.getY(), 150, 10); } public static void main(String argumendid[]){ new Pendel(); } }