Java-Text Moving Animation

Program Program Source import java.applet.Applet; import java.awt.Graphics; import java.awt.Color; import java.awt.Font; public class Javaapp extends Applet implements Runnable{ private String msg = “123456789”; private Thread t; public void start() { t = new Thread(this,”Animation”); t.start(); } public void run() { for(;;) { try{ Thread.sleep(2000); }catch(InterruptedException ex){} msg +=msg.charAt(0); msg = msg.substring(1,msg.length()); repaint(); } } public … Read more…

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; } } }

Java-Applets

Applets Applets are small java programs that run inside a web browser. The byte code for an applet is stored as part of a web page that is made available on a web server. When we download such a web page, the applet contained in it is also downloaded and executed by the web browser. … Read more…