Solved

Animated GIF's in an Application

Posted on 1998-07-14
4
180 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
  • 2
4 Comments
 
LVL 4

Expert Comment

by:evijay
Comment Utility
You can do it using JFC Swing component

0
 

Author Comment

by:lained
Comment Utility
Can it be done without swing?
0
 

Accepted Solution

by:
sulam earned 100 total points
Comment Utility
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
Comment Utility
The version is 1.1.6.

Thanks

0

Featured Post

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now