www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Melssj5 on December 13, 2004, 12:57:51 am

Title: Flashing screen on applets.
Post by: Melssj5 on December 13, 2004, 12:57:51 am
Hello, I am doing an awt applet, so I put all the rendering code in the paint (); when something happens I use repaint (); but it flashes a lot, I thing that reloading the paint is not the best way to do it, but is there someway to constantly load that piece if code without using the paint?. I want the game to run inside my applet, thanks. :shock:
Title: Flashing screen on applets.
Post by: EgonOlsen on December 13, 2004, 08:09:46 am
Try to not only override paint() but also update() and let your new update()-method call your paint()-method. That should help to get rid of the flickering. Personally, i'm used to override both with nothing and doing the updates myself using the Applet's Graphics-Instance directly, but it depends on what you are doing exactly (i.e. are you still using AWT-components or does your game fills the whole applet?) if this is good idea or not.