import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class hiir extends Applet implements MouseListener{ int x=100; int y=60; public hiir(){ addMouseListener(this); } public void paint(Graphics g){ g.drawLine(x+15, y,x+15 ,y+15 ); g.drawLine(x+7, y+7,x+30 ,y+7); } public void mousePressed(MouseEvent e){ x=e.getX(); y=e.getY(); repaint(); } public void mouseReleased(MouseEvent e){} public void mouseClicked(MouseEvent e){} public void mouseEntered(MouseEvent e){} public void mouseExited(MouseEvent e){} public static void main(String argumendid[]){ Frame f=new Frame("Vajuta hiirega"); f.setSize(300, 300); f.add(new hiir()); f.setVisible(true); } }