Solved

Animated GIF's in an Application

Posted on 1998-07-14
4
185 Views
Last Modified: 2010-04-16
I would like to know if there is a way, in the standard JDK, to setup and display an animated gif on a Canvas in an application.   I do not want the frame portion's, so I understand that using a Canvas may be a solution.  Also, this is not going to be run as an applet, but a stand alone application.

Thanks

Doug
0
Comment
Question by:lained
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 4

Expert Comment

by:evijay
ID: 1226310
You can do it using JFC Swing component

0
 

Author Comment

by:lained
ID: 1226311
Can it be done without swing?
0
 

Accepted Solution

by:
sulam earned 100 total points
ID: 1226312
You haven't specified which version of Java you're talking about here. The base 1.0 JDK does not support animated GIFs. Swing of course will ship with 1.2, but this probably won't help you. However, if you created the animation yourself, and still have the source images, you can use Animator.java (shipped with the JDK) to play the animation yourself.

If you want to do this without Swing you need to create a DataInputStream attached to the URL which is your animated GIF. You can pull the bytes off and parse them yourself, then use MemoryImageSource to display them. Needless to say this is a lot of work, and it'd be a lot easier to simply use Swing, but it does increase the size of your applet's download.
0
 

Author Comment

by:lained
ID: 1226313
The version is 1.1.6.

Thanks

0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

724 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question