Java-Simple Animation(Another Example)

Program Program Source import java.applet.Applet; import java.awt.Color; import java.awt.Graphics; public class Javaapp extends Applet { public void paint(Graphics g) { int a=150,b=150,c=10,d=10; g.setColor(Color.red); for(int i=0;i<15;i++) { try{ Thread.sleep(1000); }catch(InterruptedException ex){} g.drawOval(a, b, c, d); a-=10; b-=10; c+=8; d+=8; } } }

Java-Simple Animation

Program Program Source import java.applet.Applet; import java.awt.Graphics; public class Javaapp extends Applet { public void paint(Graphics g) { int a=100,b=100,c=10,d=10; for(int i=0;i<15;i++) { try{ Thread.sleep(1000); }catch(InterruptedException ex){} g.drawRect(a, b, c, d); a-=5; b-=5; c+=10; d+=10; } } }