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.white); g.fillRect(0, 0, getSize().width, getSize().height); g.setColor(Color.green); g.drawOval(e.getX()-5, e.getY()-5, 10, 10); g.drawLine(e.getX()-5, e.getY()-5, 150, 10); } public static void main(String argumendid[]){ new pendel(); } }