I decided to use double buffering to eliminate the flashing in my applet. But there is a problem. Instead of things moving slowly... everything is saved on to the screen and stays there. For example... the ball is suppose to move like any ball would... but instead it creates a line of balls that don't disappear. How can I fix this?
Originally posted by Martin vanPutten: I was just told how to double buffer... I don't know what swing double buffers are.
The sweet thing is that you don't have to know anything. It's part of the furniture. Just write the code that renders in a simple manner and if you are using Swing components, they will take care of the double buffering.
Originally posted by Martin vanPutten: I was just told how to double buffer... I don't know what swing double buffers are.
Where are you using double buffering?
This is an example of how you use it.
Notice that the only thing you have to do to implement double buffering with Applet is override update so it only call paint, and then in paint draw on the offscreen image. After the offscreen image is finished, then display it.
The sweet thing is that you don't have to know anything. It's part of the furniture. Just write the code that renders in a simple manner and if you are using Swing components, they will take care of the double buffering.
The sweet thing is that you don't have to know anything. It's part of the furniture. Just write the code that renders in a simple manner and if you are using Swing components, they will take care of the double buffering.
I was asking if you knew Swing because most Java programmers who have the choice prefer Swing over the AWT. From your answer, although unclear, I assume you don't know Swing. Then I can't help you. I also avoid applets, but that's a story for another time...