aspose file tools*
The moose likes Applets and the fly likes animated image in applet Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » Applets
Bookmark "animated image in applet" Watch "animated image in applet" New topic
Author

animated image in applet

Jeannie Yong
Greenhorn

Joined: Oct 18, 2001
Posts: 19
When I tried to show a moving picture in a applet, the picture always flash. I call repaint() several times to let the picture move, is it the reason why picture flash? Thanks
Manfred Leonhardt
Ranch Hand

Joined: Jan 09, 2001
Posts: 1492
Hi Jeannie,
The picture flashes because Java has a method called update that erases the screen and then calls paint. This is the method that actually gets called when you call repaint.
To change the behavior you can override the Update method and make it only call paint.

Regards,
Manfred.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: animated image in applet
 
Similar Threads
help w/ game involving threads and drawImage
What is a good front end to use for a Java web based game?
wacht a camera with JSF2.0
the position of component in applet
Flash Movie in Java Applet