import java.applet.*; import java.awt.*; import java.awt.event.*; import java.awt.geom.*; public class Kujund1 extends Applet implements MouseMotionListener{ Ellipse2D.Double muna= new Ellipse2D.Double(50, 30, 40, 60); boolean sees=false; public Kujund1(){ addMouseMotionListener(this); } public void paint(Graphics g0){ Graphics2D g=(Graphics2D)g0; if(sees){ g.setColor(Color.BLUE); } else { g.setColor(Color.BLACK); } g.draw(muna); } public void mouseMoved(MouseEvent e){ if(muna.contains(e.getX(), e.getY())){ sees=true; } else { sees=false; } repaint(); } public void mouseDragged(MouseEvent e){ } public static void main(String[] arg){ Frame f=new Frame(); f.add(new Kujund1()); f.setSize(300, 300); f.setVisible(true); } }