import java.awt.*; import java.applet.*; import java.awt.event.*; public class lained extends Applet implements MouseListener{ int x=200; int y=200; int a=2; int a2=2; int b=0; int b2=0; int i; int kiirus=50; public lained(){ addMouseListener(this); } public void paint(Graphics g){ for (i=0; i<15; i++){ try{Thread.sleep(kiirus+(15*i));}catch(Exception e){} g.drawOval(x-a, y-a, 2+a+a, 2+a+a); a=a+1+b; b++; if (i>5){ Graphics2D d=(Graphics2D)g; d.setColor(Color.white); g.drawOval(x-a2, y-a2, 2+a2+a2, 2+a2+a2); a2=a2+1+b2; b2++; d.setColor(Color.black); } } for(i=6; i<15; i++){ try{Thread.sleep(kiirus+(15*i));}catch(Exception e){} Graphics2D d=(Graphics2D)g; d.setColor(Color.white); g.drawOval(x-a2, y-a2, 2+a2+a2, 2+a2+a2); a2=a2+1+b2; b2++; } } public void mousePressed(MouseEvent e){ a=2; a2=2; b=0; b2=0; 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(); f.add(new lained()); f.setSize(400, 400); f.setVisible(true); f.addWindowListener(new aken_kinni()); } } class aken_kinni extends WindowAdapter{ public void windowClosing(WindowEvent e){ System.out.println("Programm kinni"); System.exit(0); } }