import java.applet.*;
 import java.awt.*;
 /*
 <applet code=”App6.class” width=”550″ height=”350″>
 </applet>
 */
 public class App6 extends Applet{
 public void init(){
 setBackground(Color.yellow);
 setForeground(new Color(88,200,0));
 }
 int x=20;
 int flag=0;
 public void paint(Graphics g){
 if(x==20)
 flag=0;
 if(x>=500)
 flag=1;
 if(flag==0)
 x=x+5;
 if(flag==1)
 x=x-5;
 g.fillOval(x,20,40,40);
 try{
 Thread.sleep(200);
 }catch(InterruptedException e){
 }
 repaint();
 }
 }
 
//——————————————————————–
 
import java.applet.*;
 import java.awt.*;
 /*
 <applet code=”App5.class” width=”350″ height=”350″>
 </applet>
 */
 public class App5 extends Applet{
 public void init(){
 setBackground(Color.yellow);
 setForeground(new Color(88,200,0));
 }
 public void paint(Graphics g){
 g.setColor(Color.green);
 g.fillOval(100,100,70,70);
 try{
 Thread.sleep(500);
 }catch(InterruptedException e){
 }
 g.setColor(Color.yellow);
 g.fillOval(100,100,70,70);
 try{
 Thread.sleep(500);
 }catch(InterruptedException e){
 }
 repaint();
 }
 }
 
//————————————————————————
 
import java.applet.*;
 import java.awt.*;
 /*
 <applet code=”App4.class” width=”350″ height=”350″>
 </applet>
 */
 public class App4 extends Applet{
 public void init(){
 setBackground(Color.yellow);
 setForeground(new Color(88,200,0));
 }
 int flg=0;
 int w=20,h=20,x=100,y=100;
 public void paint(Graphics g){
 g.fillOval(x,y,h,w);
 if(h==100)
 flg=1;
 if(h==20)
 flg=0;
 if(flg==0){
 h=h+5;
 w=w+5;
 x=x-1;
 y=y-1;
 }
 if(flg==1){
 h=h-5;
 w=w-5;
 x=x+1;
 y=y+1;
 }
 try{
 Thread.sleep(500);
 }catch(InterruptedException e){
 }
 repaint();
 }
 }
 
//——————————————————————–
 
import java.applet.*;
 import java.awt.*;
 /*
 <applet code=”App3.class” width=”350″ height=”350″>
 </applet>
 */
 public class App3 extends Applet{
 public void init(){
 setBackground(Color.yellow);
 setForeground(new Color(88,200,0));
 }
 int w=20,h=20,x=100,y=100;
 public void paint(Graphics g){
 g.fillOval(x,y,h,w);
 h=h+5;
 w=w+5;
 x=x-1;
 y=y-1;
 try{
 Thread.sleep(500);
 }catch(InterruptedException e){
 }
 repaint();
 }
 }