import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class Hiirekuular extends Applet implements MouseListener{ int X,Y; public void init(){ addMouseListener(this); } public void mousePressed(MouseEvent e){ Graphics g=getGraphics(); // g.setColor(Color.white); // g.fillRect(e.getX()-15, e.getY()-15, 30, 30); g.setColor(Color.black); g.drawOval(e.getX()-15, e.getY()-15, 30, 30); X=e.getX();Y=e.getY(); } public void mouseReleased(MouseEvent e){ Graphics g=getGraphics(); g.setColor(Color.blue); g.drawOval(e.getX()-5, e.getY()-5, 10, 10); g.setColor(Color.white); g.drawOval(X-15,Y-15, 30, 30); } public void mouseExited(MouseEvent e){ Graphics g=getGraphics(); g.setColor(Color.white); g.fillRect(0, 0, getSize().width, getSize().height); } public void mouseEntered(MouseEvent e){} public void mouseClicked(MouseEvent e){} }