Displaying a GIF in Java.

This is a discussion on Displaying a GIF in Java. within the A Brief History of Cprogramming.com forums, part of the Community Boards category; I recall posting a thread like this a few days ago but I searched and couldn't find it anywhere, so ...

  1. #1
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913

    Displaying a GIF in Java.

    I recall posting a thread like this a few days ago but I searched and couldn't find it anywhere, so I"m just assuming there was an error and it never got processed.

    This is for my NASA game. Could someone tell me what function to use for displaying animated GIFs in a Java applet? If you could name the function I should be able to find the documentation at Sun's Java website, but I search that for "GIF" and couldn't find anything. Thanks in advance if you can help.

  2. #2
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    i think i said somethign the last time about trying www.codeguru.com/forum

    but i'm not a java programmer so beyond that i can't help you much but....

    if you've found a program that uses gifs, get a java class decompiler and you can figure out how to do it.
    PHP and XML
    Let's talk about SAX

  3. #3
    CS Author and Instructor
    Join Date
    Sep 2002
    Posts
    511

    Smile

    You can do this - however it is something 'beginners' don't usually do.

    I could tell you but- go to www.javaranch.com and their boards and probably someone with more time could help you out.
    Mr. C: Author and Instructor

  4. #4
    Super Moderator
    Join Date
    Sep 2001
    Posts
    4,913
    Alright - I looked up the subject at JavaRanch, and I found out how to display the GIF. The problem however, is that if you're displaying an animated GIF, all the user sees is the first frames - apparently it happens to everything when the applet gets serialized. The only thing I need to animate however, would be a little rectangular window. It wouldn't even need to be animated. I just need it to show sections of a blue circle, and then turn red. I was thinking I could draw the shape where I wanted it, and then place everything else but the window around it, so all you'd see is what you'd see through the window. The only thing I need to learn how to do is, get this transparent section in the original picture. Can I just use transparent colors or is there something else I need to do?

  5. #5
    PC Fixer-Upper Waldo2k2's Avatar
    Join Date
    May 2002
    Posts
    2,001
    i really don't know how many people here are good at java, i know im' not, and mister c was the only other who replied, you'd probably get a quick answer here:
    http://www.codeguru.com/forum/forumd....php?forumid=5

    good luck
    PHP and XML
    Let's talk about SAX

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C#, Java, C++
    By incognito in forum A Brief History of Cprogramming.com
    Replies: 10
    Last Post: 10-05-2004, 03:06 PM
  2. The Java language is being expanded
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 06-11-2004, 10:07 PM
  3. Java woes
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 15
    Last Post: 07-06-2003, 01:37 AM
  4. Displaying a transparent gif
    By Just in forum Windows Programming
    Replies: 2
    Last Post: 05-09-2003, 10:53 PM
  5. Displaying GIFs in Java Applets
    By sean in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 11-18-2002, 12:43 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21