Author Topic: Flashing screen on applets.  (Read 3803 times)

Offline Melssj5

  • double
  • *****
  • Posts: 724
    • View Profile
Flashing screen on applets.
« 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:
Nada por ahora

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Flashing screen on applets.
« Reply #1 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.