Hi folks! I have written a simple applet that will display an animated gif (a small gif that looks like two eyes that move from side to side). The eyes.gif file is very small (1kb). When I add complexity of design, by adding 2 panels using a borderLayout design ... I have to press the button 2 times to get the animated gif image to display AND the image appears to be static instead of animated. The static gif loads fine the first button click. Here is the code - if you substitute the images with some on your own computer it should work.
posted 17 years ago
hi folks! after searching around on the web, I found an example applet that has some prety sophisticated graphics going on and studied the code to learn how to do what I asked about. I am building an applet with several panels and wanted to be able to add some gifs to display in response to user interactions. Here's the applet I found and studied - http://academic1.bellevue.edu/lander/lander.html This forum seems pretty quite ... let me know if I can help you with similar problem. firstname.lastname@example.org
Swing components already "know" how to support aGifs, if I recall correctly. You may not need to do anything more special than to draw an aGif in a Swing container. You just need to use JApplet, and JPanels, etc, instead of the older AWT equivalents.
Wait for it ... wait .... wait .... NOW! Pafiffle! A perfect tiny ad!
Devious Experiments for a Truly Passive Greenhouse!