import java.awt.Image;
import java.awt.Graphics;
public class Animation1 extends java.applet.Applet {
Image bild;
public void init() {
bild = getImage(getCodeBase(), "bild.gif");
resize(600, 200);
}
public void paint(Graphics g) {
for (int i=0; i < 1000; i++) {
int bildbreite = bild.getWidth(this);
int bildhoehe = bild.getHeight(this);
int xpos = 10; // Startposition X
int ypos = 10; // Startposition Y
g.drawImage(bild, (int)(xpos + (i/2)),
(int)(ypos + (i/10)), (int)(bildbreite * (1 +
(i/1000))),(int) (bildhoehe * (1 + (1/1000))),
this);
}
}
}
Hier ist der Bereich, in dem das Applet zeichnen darf:
Und hier geht es wieder weiter auf der Seite.