Flicker free animation
From: Bob Jackson (bjackson_at_nospamplease.net)
Date: 06/20/04
- Next message: Andrew Thompson: "Re: Flicker free animation"
- Previous message: Noe: "Listener and events"
- Next in thread: Andrew Thompson: "Re: Flicker free animation"
- Reply: Andrew Thompson: "Re: Flicker free animation"
- Reply: Roedy Green: "Re: Flicker free animation"
- Reply: Gawnsoft: "Re: Flicker free animation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Sun, 20 Jun 2004 08:34:10 -0700
Hey guys,
I am attempting to achieve flicker-free animation, but am having some
issues. I created a JFrame containing a JPanel. I overrode the JFrame's
paint() method to display a background image in the JPanel and then
superimpose another image on top of it (a car that moves). Unfortunately,
whenever there is movement, both the background and car flicker. I don't
quite understand why this is occurring - JFrame's update() description
indicates that it does not clear the screen so I thought that wouldn't have
been the issue (I overrode the update to just call paint() just for good
measure also). A couple interesting/perplexing observations: When I remove
the super.paint() call in my overridden method, the flickering stops (of
course I then don't get a couple of button's drawn on the screen like I want
either) and I also tried making setting the opaque flag of the JPanel to
false, but that didn't do anything. Can anyone offer any advice?
Thanks
Bob
- Next message: Andrew Thompson: "Re: Flicker free animation"
- Previous message: Noe: "Listener and events"
- Next in thread: Andrew Thompson: "Re: Flicker free animation"
- Reply: Andrew Thompson: "Re: Flicker free animation"
- Reply: Roedy Green: "Re: Flicker free animation"
- Reply: Gawnsoft: "Re: Flicker free animation"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]