import java.applet.Applet; import java.awt.*; import java.awt.event.*; public class Hiirekuular extends Applet implements MouseListener{ public Hiirekuular(){ init(); } 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.red); g.drawOval(e.getX()-15, e.getY()-15, 30, 30); g.drawString(e.getClickCount()+"",e.getX(), e.getY()); } public void mouseReleased(MouseEvent e){ Graphics g=getGraphics(); g.setColor(Color.blue); g.drawOval(e.getX()-5, e.getY()-5, 10, 10); } 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){} }