• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to display animated gif within an applet that has panels ???

 
david eberhardt
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

thank you!
 
david eberhardt
Ranch Hand
Posts: 158
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
dkeber2000@hotmail.com
 
Rob Ross
Bartender
Posts: 2205
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic