TODAY JAVA SCHOOL

In java school, programming, design, computer general knowledge, web application, software, web services, social media, digital marketing, oops, concept of programming language, oops feature, console media, graphics medium, first programming, c, c ++ , Java, PHP, SQL, MySQL, HTML, HTML_5, J_query, JavaScript, Bootstrap, Framework, images with logos, examples, shared and explained.

https://www.amazon.in/b?node=26373545031&linkCode=ll2&tag=1234567801cdb-21&linkId=3b9882431b00409b44141e0344b35a15&language=en_IN&ref_=as_li_ss_tl

Breaking

Saturday, 11 April 2020

Animation In Java Applet | Java Animation Moving Object

                               Animation in Applet

Applet is mostly used in games and animation. For this purpose image is
required to be moved.

image animation in applet

Fig: Animation In Applet 

Example of animation in applet:

       import java.awt.*;   
       import java.applet.*;  
       public class AnimationExample extends Applet {  
       Image picture;  
       public void init() {  
       picture =getImage(getDocumentBase(),"bike_1.gif");  
       }         
       public void paint(Graphics g) {  
       for(int i=0;i<500;i++){  
       g.drawImage(picture, i,30, this);  
      try{Thread.sleep(100);}catch(Exception e){}  
    }  
  }  

myapplet.html 

      <html>  
      <body>  
      <applet code="DisplayImage.class" width="300" height="300">  
      </applet>  
      </body>  
       </html>  

No comments:

Post a Comment