look at the image and applet api and then create an image with the getImage method in the applet api
once youve created it, paint it in the paint method
to paint:
g.drawImage(Image imageName, int xPosition, int yPosition, Component? imageProducer/**u can just use this*/);
then youll prolly hav a speed variable.
just do things like
xPosition += xSpeed;
and
yPosition += ySpeed;
then the update method to make it not flash... rememb to add Graphics dbg as an instance variable...
public void update(Graphics g)
{
if (dbImage == null)
{
dbImage = createImage (this.getSize().width, this.getSize().height);
dbg = dbImage.getGraphics ();
}
dbg.setColor (getBackground ());
dbg.fillRect (0, 0, this.getSize().width, this.getSize().height);
dbg.setColor (getForeground());
paint (dbg);
g.drawImage (dbImage, 0, 0, this);
}