Solved

Animated GIF's in an Application

Posted on 1998-07-14
4
184 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Suggested Solutions

Title # Comments Views Activity
jdbc error in jsp application 20 86
tomcat startup error 5 162
runtime exception 2 63
Tomcat 9 + java 8 error while trying to deploy a war file 2 846
INTRODUCTION Working with files is a moderately common task in Java.  For most projects hard coding the file names, using parameters in configuration files, or using command-line arguments is sufficient.   However, when your application has vi…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn about the regular for loop in Java and how to use it. Definition: Break the for loop down into 3 parts: Syntax when using for loops: Example using a for loop:
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

737 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