Flickering Images as moved accrost applet screen

I'm trying to create a simple game, more or less shooting something as it scrolls around.. Anyway the only way I've figured out how to move the images, is by posing the background, then the things being shot with the new coordinate, then repaint();. Doing this obviously causes siezures because everything is so flickery. Here's an example of how I'm doing this.

for( int a=0; a<50;a++){

gr.drawImage( background, 0, 0, this );

gr.drawImage( movingThing, a, 50, this );

this.pause();

}

Technically, it gets the job done...but it's like pounding in a screw with a hammer...it just isn't effecient. Any feedback would be greatly appreciated.

[691 byte] By [Rocksbaseballa] at [2007-10-3 9:22:18]
# 1
Okay, and whoever fixes this problem will get 10 duke dollars.
Rocksbaseballa at 2007-7-15 4:35:56 > top of Java-index,Java Essentials,Java Programming...
# 2
google double buffering
mkoryaka at 2007-7-15 4:35:56 > top of Java-index,Java Essentials,Java Programming...
# 3
[url http://www.realapplets.com/tutorial/DoubleBuffering.html]Double Buffering Example[/url]You need to draw everything to an offscreen image, then draw that image to the screen.
CaptainMorgan08a at 2007-7-15 4:35:56 > top of Java-index,Java Essentials,Java Programming...
# 4
I'm only going into my second year of Java, I read up a little bit on double buffering, but I don't know how to incorperate that into my program.
Rocksbaseballa at 2007-7-15 4:35:56 > top of Java-index,Java Essentials,Java Programming...
# 5
Ahh thank you so much Captain, that actually puts it all into perspective. Enjoy the 10!!
Rocksbaseballa at 2007-7-15 4:35:56 > top of Java-index,Java Essentials,Java Programming...