Need help importing animated gif by ImageIcon in Japplet

Hello. Im new to Java, but I want to import this animated gif with Java in a Japplet using ImageIcon, but it does not work and I would really appreciate if anyone could help me with this.
import java.applet.*;                                   
import java.awt.*;   
import java.net.*;
     public class Bilder extends Japplet{                               
     public ImageIcon(java.net."http://pixelninja.se/kappawin.gif");
  Image[] bild = new Image[1];                            
  int nr=0;                                                
  public void init(){                                     
    setBackground(Color.black);                         
    bild[0] = getImage(getCodeBase(),"4a.gif");     
  public void paint(Graphics g){
    g.drawImage(bild[0],50,50,212,282,this);
}

You cant do animated gifs this way.
Also you should remember that you cannot load images in to an applet if it is hosted somewere else than the host that hosts the applet.
Esiast way to display an image icon with a animated gif will be creating a Image Label and adding it to the applet.
Ex:-
public class MyImageApplet extends JApplet{
   public void init(){
      getConentPane().setLayout(new BorderLayout());
       URL imageURL = getClass().getResource("/myImage.gif"); 
      // Above image file should be in the code base or in the archive file of the applet
      getConentPane().add(new JLabel(new ImageIcon(imageURL)));
}

Similar Messages

  • [need help with animated gif - shows up fuzzy on IE]

    Hi,
    I created an animated gif in photoshop cs3 with combination of text and images in Mac.  For some reason, the text on the banner looks fuzzy on Internet Explorer. Do any of you know what is wrong with the banner?  Can anyone help me on this?
    Thanks

    How does it look in Firefox on Windows? By only testing one browser on Windows, you cannot determine if it is a matter of the browser or the overall settings for the computer.
    Do you have a page to share so that we can see the fuzziness or can you post the GIF file here?

  • I need help importing navigation bars and rollover buttons from fireworks?

    I need help importing navigation bars and rollover buttons from fireworks, drop down menus and rollover states won't work!
    Thanks

    In my experience, the code created by graphics apps is less than satisfactory. And image based menus are very awkward for several reasons. 
    #1 If you decide to change your menu later, you must go back to your graphics app and re-craft the whole thing.  After 2-3 times of this, it gets old in a hurry.
    #2 Image based menus cannot be "seen" by search engines, screen readers and language translators.
    #3 CSS styled text menus are better for your site's visibility, accessibility and they are a snap to edit in Dreamweaver.
    That said, if you're still married to image based menus, use Fireworks to create images only. Use Dreamweaver's Image Rollover Behaviors to create your rollover scripts.
    Nancy O.

  • Import animated GIF from Photoshop?

    I have a question... I am unable to create custom animated gif's in Photoshop 5/6 and import them into Captivate 7.  It just says "The GIF file contains errors".  I've tried exporting on multiple settings and still no luck, same with exporting from Fireworks.
    I am however able to import an exported gif from Flash, yet the quality is horrible and the transparency is buggy.  Is anyone else having this issue, or is there some setting that I am missing?  Basically I need to animate some images within a Captivate project, without the need of using a .SWF (for HTML5 output). Any help would be much appreciated, thank you.

    I experienced this issue with Captivate 8 and Photoshop CC... 
    I eventually realized if the animation has any frames with "no delay" I would get the error.  Changing those frames to a 0.1 second delay resolved my issue.  Not sure if this is the same bug you are experiencing but it's worth a try!

  • Importing animated gif

    I am trying to import an animated gif into a pre-existing layered photoshop file. I am using photoshop CS3 on a Mac OS X 10.5. I tried file -> import -> video frames to layers, but it does not recognize the gif file and there is no place to manually type in the name of the file. I also have adobe fireworks which is able to open the file, but I couldn't figure out how to then tranfer that back into photoshop as layers. I was told that .mov files can be imported into photoshop directly, but when I change the extention on my file I lose the layers. I'm not sure if there is another way, or if I need to post in the fireworks thread to determine how to export the frames into photoshop. Any help would be greatly appreciated.
    Jessica

    You can't do it on a Mac with CS3 and 4 you need CS2. Use that if you have It.

  • How do I import animated gifs into Premiere with a transparent background?

    I have an animated gif that I got from the internet, and I'm trying to import it into Premiere Pro with a transparent background. The gif is of a video game character standing still and blinking. Whenever I import it, it always has a white background, so I need help on how to change that.
    I've gone into Photoshop and removed the white background frame by frame, making it transparent. I do this by using the magic wand tool to select the white background, then hit "delete" to turn it into that diamond grid, which means it's transparent. I then select File -> Save for Web. I preview every frame, and it shows that the backgrounds are transparent. I save it as a gif. But when I import it into Premiere Pro, the white background is still there.
    I've read many forums online about people trying to import images into Premiere Pro with a transparent background, but none of them have explained how to do it specifically for animated gifs. Every answer has always been "export the image as a png, that'll work", and sure enough, I exported a few frames of the gif as pngs, and those few frames had transparent backgrounds in Premiere Pro. But I don't want a png because those aren't animated sequences, those can only be still images. I need to export it as a gif so that it will remain animated, but gif files always have that dreaded white background in Premiere Pro.
    I suppose I could export every frame as a png, import each of those frames into Premiere Pro, then string all the frames together and tweak them so they'll be functionally identical to the animated gif, but that would take forever. I'm making a video project and I need numerous animated gifs to work with, so I don't want to do that with every single one of them. I'm looking for a way to simply import the gifs into Premiere Pro and be done with it. If there is any way to do this, please help me.
    -Robert

    faind on gif transparency and other cartoon animation problems : Adobe After Effects
    " The reason: GIFs don't support alpha channels. Instead, their file structure assigns a certain color value to be read as totally transparent. There aren't any degrees of transparency as you find in graphics formats that do support alpha channels.
    To use an animated gif in AE, you'd first have to create the areas of transparency, then convert the series of images into a graphics format that supports alpha channels, and there are a bunch: PICT, TIFF, TARGA or PNG, to name a few."

  • I am having major issues importing Animated gif's into Adobe Captivate

    Hi everyone
    Captivate 7 (64 bit) keeps crashing when i import animate gifs into flash.
    It's a serious workflow issue for us as the project requires animated gifs.
    I don't have any files to supply for this query as i can't even import gif's into a blank doc.
    Has any one found a solution for this issue ?
    Adobe ??  Have you got a fix for this bug ?
    Thanks in advance
    Nick

    How were the GIF's created? Which version of 7 do you use, you can see the complete version number under Help, About Captivate.
    I have been using animated GIF's in 7, they were created with Photoshop. And I know that each frame in the animation has to have a duration that is not 0secs.

  • Importing animated gif files

    Hello,
    I have some animated gif files that i would like to import into framemaker.
    The problem is that these animated gif does not activate. Is Framemaker compatible with animated gif's?
    Out of this framemaker file we would like to extract a pdf and a microsoft html help file (via e-publisher).
    How do i keep these gif files animated in Framemaker & pdf?
    We are working with Framemaker 8.0 on a windows vista operating system.
    PDF = adobe acrobat 9 pro.
    Bjorn

    If you are using FrameMaker and WWeP you can certainly use a reference to the animated GIF and pull the animated source into your HTML help from WWeP. Check a WWeP forum on doing that.
    Also, PDF now supports Flash. Have you tried using Flash animations?
    HTH,
    Sean

  • Importing animated gif into layout

    I have a regular FW layout that I exported as an HTML to open
    up in Dreamweaver, and use as a homepage. Everything works fine.
    But now I would like to add an animated GIF that I created in FW,
    to the page, but I'm not really sure if it is possible. I opened up
    the PNG file for the homepage in FW then imported my animated gif,
    but it doesn't run when previewed. This is our page the FW layout
    is in the center with my dreamweaver template applied to the top
    and sides.
    http://www.shreveaudio.com
    ...FYI the animated GIF isn't on the page if you visit the link.
    Any help is much appreciated.

    Add the animation in Dreamweaver instead of in Fireworks.
    Linda Rathgeber [PVII] **Adobe Community Expert-Fireworks**
    http://www.projectseven.com
    Fireworks Newsgroup:
    news://forums.projectseven.com/fireworks/
    CSS Newsgroup: news://forums.projectseven.com/css/
    Design Aid Kits:
    http://www.webdevbiz.com/pwf/index.cfm

  • Cannot Import Animated Gif

    Hi all. I have been following the Lynda tutorials for Captivate 5 for Mac, and I'm at the point where they are inserting animated .gif files. When I attempt to insert the image via Insert > Animation, and select the file I receive the message that "The file is not an animated GIF file", and then nothing imports to the stage.
    I downloaded an animated .gif from the web and tried to import that, but same result. They both open up on Photoshop fine.
    Can anybody help me with this issue?

    Hi,
    In my envirement...
    If the animations frames set to "No Delay (0 Sec)" in PhotoShop, once import the GIF file to Captivate will get "The file is not an animated GIF file", if import the GIF file to Media Encoder will have problem too.
    Please try set frames to 0.1 seconds at least
    Pan Ming

  • Problam with animated gif in ImageIcon

    hello, i'm using ImageIcons to insert animated gifs to my TextPane (using the insertIcon method). anyway for some reason the animated rate changes sometimes its too fast, sometimes too slow. how do i make sure the animated gifs wil "play" in the correct rate?

    If you only want the center region to be animated, you need to splice it out to its separate file and re-assemble the whole shebang later
    Or you could just change the center part and export the whole thing as an animated gif. If you have 3 frames and you only want the center piece to change, leave the background on all 3 frames but have a different center on each of the frames. Whole thing will be animated but will only look like the middle is changing.

  • Help with animated gif messages

    I can't seem to get animated GIFS with music as a SMS or a MMS to play. They are sent from people with phones like the Razor, LG, Envy etc. on the same network as mine ( Verizon ). When I get the message it will show the GIF for about 1 second then it dissapears, then the music plays. It will also give me the option to open the attachments or slides but the GIFS don't open . I can get Video messages from anyone and the videos plays fine. In the past when I opened one of these messages it would kill the audio on my phone and I would have to do a hard reboot for my phone to work even though I could still receive SMS and MMS messages, just the audio on the phone died. I was told the new OS 4.5 would correct this. The only thing it fixed was now if I get a animated GIF message it still does not play but my phone does work and I don't have to reboot. Is there a setting I need to change or is this not supported? I have 2 Curves 8330 OS 4.5.0.77 BIS on Verizon with the unlimted BB plan.
    Thanks,
    Leo
    Solved!
    Go to Solution.

    GIF file format is not supported by Blackberry. Check the details of the supported file formats by BlackBerry.
    tanzim                                                                                  
    If your query is resolved then please click on “Accept as Solution”
    Click on the LIKE on the bottom right if the post deserves credit

  • Help with animated gif please!

    Can you embed an animated gif into emails as a signature? i
    have tried it in entourage and outlook, but the gif seems to stick
    on the first frame. The animation works fine if viewed in a browser
    etc. I have also made the email html format.
    any ideas?

    Open your browser and browse to and select the animated GIF
    image. Do you
    see the animation? If not, then you have not properly
    exported your GIF as
    an animated one. What graphics program are you using?
    Murray --- ICQ 71997575
    Adobe Community Expert
    (If you *MUST* email me, don't LAUGH when you do so!)
    ==================
    http://www.dreamweavermx-templates.com
    - Template Triage!
    http://www.projectseven.com/go
    - DW FAQs, Tutorials & Resources
    http://www.dwfaq.com - DW FAQs,
    Tutorials & Resources
    http://www.macromedia.com/support/search/
    - Macromedia (MM) Technotes
    ==================
    "PZE" <[email protected]> wrote in message
    news:eiiu8c$pdm$[email protected]..
    > You made an animated GIF in Fireworks, yes? yes
    > It works? Animates as you wish? yes
    > Then you insert it in DW and you see the image, yes?
    no.no.no
    > Static in DW (DW will NOT display the animation) but
    when you preview the
    > page
    > in a browser it
    > doesn't animate as expected? no, unfortunately not, or
    else there would
    > be no
    > problem
    >
    > perhaps I am saving or exporting incorrectly. for the
    animation previews
    > clearly in fireworks, but then I dont get anything in
    dreamweaver, neither
    > static image on work page or animation in preview
    > Please, I would appreciate a little clarity here for
    this site has to be
    > up
    > tonight
    > thanks for any help and explanations
    >

  • Problem with importing animated gifs

    Hi i'm trying to use an animated gif in my project. Basically my after effects project is just a countdown from 10 to 0 while the animated gif spins continuously during the countdown. My problem is when I use the animated gif the background it is no longer transparent and the background is instead white. How do I make it transparent again in after effects? Next the animated gif is about a 2 second loop, it won't let me drag the bars to extend the time to 10 seconds. How do I loop it for 10 seconds?
    These aren't musts, but if anyone could, help would be greatly appreciated:
    1) For the text effect 'numbers' (which I used for the countdown effect) it always renders really shaky and bouncy when i preview it. Is that normal?
    2) It has the time as 00:00:00:00 (type: timecode 30). How do I make so it only shows 00:00 ?
    Any help would be awesome.
    Thank you

    My problem is when I use the animated gif the background it is no longer transparent and the background is instead white.
    Correct. As a conmpositing program, AE requires proper Alpah transparency, not palette-based transparency. File must be converted to an image sequence with Alpha channel.
    Next the animated gif is about a 2 second loop, it won't let me drag the bars to extend the time to 10 seconds. How do I loop it for 10 seconds?
    Footage interpretation --> Loops
    1) For the text effect 'numbers' (which I used for the countdown effect) it always renders really shaky and bouncy when i preview it. Is that normal?
    Yes, it's normal if you are using a non-monospaced font. Use a suitable font.
    2) It has the time as 00:00:00:00 (type: timecode 30). How do I make so it only shows 00:00 ?
    Use multiple layers and effects and mask them out.
    Mylenium

  • Need help with animation, for my XAML game

    Hello friends,
    I need help in creating animation for my snake and ladder game(C#,XAML). I have completed the game logic, but can't understand how to animate my UI.
    1. I want to animate 6 dice images so that when the player clicks on the Roll Dice Button a shuffle animation will play, and while the animation is playing the user can't click any thing.
    2. I want the player disc to move one step at a time (animation) on the game board.
    Please help me I am new to animation. Kindly give a reply

    Hello,
    I would recommend using
    Storyboards and / or the
    XAML animation library.
    Other resources:
    Storyboarded animations (XAML)
    XAML animation library sample
    I hope this helps,
    James
    Windows SDK Technologies - Microsoft Developer Services - http://blogs.msdn.com/mediasdkstuff/

Maybe you are looking for

  • No internet in santa fe springs, CA 90670

    I haven't had internet since earlier today. The router seems to be working properly. My laptop and other devices connect to it but have no internet. On the router the internet light is not lit. 

  • Remittance Advice to Vendor through EDI, message REMADV

    Hi Guru I want to send a remittance advice to vendor only through EDI after running payment run. But standard SAP requires configuration for Vendor and as well as House Bank and generates two Idocs one for bank(Message type PAYEXT-PEXR2002) and one f

  • Downpayments should auto reduce while APP run, net amount only need to pay?

    Hi We are in Go-Live phase. Client requirement is as follows: After P.O. Creation, Down Payment will be made with reference to respective of that P.O. MIGO & MIRO will be done as per business process (Here while doing MIRO Down Payment existed agains

  • Can I get information regarding the client browser using JSP

    can I get information regarding the client browser using JSP. like.. name, screen resolutions, font type, screen width and height of the browser etc., if possible then please give me the samples.. thanks,

  • Having problem with to_lob function

    Hi, Oracle DB version: 10.2.0.1.0 Tools being used: SQL Developer and SQLPlus (I have tried the query on both) Create table test col_xml LONG ...Note: We cannot convert this column to CLOB permanently because we just don't have the right to do that.