Add animated gif to JFrame toolbar in place of default coffee cup

Hi,
I am sorry if someone has already asked this question. I have searched the forums but only found aswers relating to adding static images to replace the default coffee cup. Is it possible to replace this image with an animated gif? When I add an animated gif with the following code:
URL imageUrl = myProgram.class.getResource("image.gif");
ImageIcon icon = new ImageIcon(imageUrl);
JFrame frame = new myProgramFrame();
frame.setIconImage(icon.getImage());
I am loading the image from an executable jar.
The program fails to load (but produces no errors).
Thank you for any help you can offer.

Hmmm ... intrestin, I've just modified a *.gif file of my own to make the icon animated and 'java MyProgram' just hangs at the command line -so, I guess you're stuffed with it. I can't think of a workaround either, sorry

Similar Messages

  • How do I add animated .gif files to a JFrame?

    Hi, I'm making an underwater scene in java for my degree assignment. I have a JFrame with an underwater background and a bunch of .gif fish moving around inside, but they should be animated and they're not. They animate outside of java. How can I make the .gif files animate?

    Hi, I'm making an underwater scene in java for my
    degree assignment. I have a JFrame with an underwater
    background and a bunch of .gif fish moving around
    inside, but they should be animated and they're not.
    They animate outside of java. How can I make the .gif
    files animate?A simple example:
    /* save as AnimeGif.java */
    import javax.swing.*;
    import java.awt.*;
    import java.util.*;
    class AnimGifPanel extends JPanel{
      Image[] imgs;
      int w, h;
      Random rand;
      public AnimGifPanel(Image[] ims, int wid, int hei){
        imgs = ims;
        w = wid;
        h = hei;
        setPreferredSize(new Dimension(w, h));
        setBackground(Color.cyan);
        rand = new Random();
      public void paintComponent(Graphics g){
        super.paintComponent(g);
        for (int i = 0; i < imgs.length; ++i){
          g.drawImage(imgs, rand.nextInt(w), rand.nextInt(h), this);
    public class AnimeGif{
    public static void main(String[] args){
    String filename = "fish.gif"; // an animated gif
    JFrame frame = new JFrame();
    frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    Container con = frame.getContentPane();
    Image[] ia = new Image[5];
    for (int i = 0; i < ia.length; ++i){
    ImageIcon ic = new ImageIcon(filename);
    ia[i] = ic.getImage();
    AnimGifPanel agp = new AnimGifPanel(ia, 500, 400);
    con.add(agp, BorderLayout.CENTER);
    frame.pack();
    frame.setVisible(true);

  • How can I add animated gifs to a slideshow?

    I want to  put some animations into my slideshows.
    I want to add in animated gifs. I can do this with Videowave (Roxio). Can I do the same thing with elements 8?

    Double click on the photo in the thumbnail tray at the top to get into the edit mode.  There Control (right) - click on the image and select Duplicate from the contextual menu.
    Go back to the slideshow mode and there will be two copies of the photo in the tray which you can place wherever you want.
    OT

  • How to add Animated GIF to an iWeb '11 page?

    Trying to take our existing website (not created in iWeb) and recreate in iWeb.  Have an animated GIF on our home page.  When I try to drag the GIF to the iWeb page, it's no longer animated.  And when I publish, again it's no longer animated.  I need help.
    Doug

    It should play.  Publish you site to a folder on the hard drive and open it locally to see if it plays there.
    What's the URL of your site so we can examine it first hand?
    Make sure there's no object under the gif file.  I found trying to put an image behind it would kill the gif and require me to remove the give and add it again to the page.  They seem to be a little picky.
    OT
    Message was edited by: Old Toad

  • Why don't apple add animated gifs support on their products

    It's so annoying that their products still don't support animated gifs it will be great if they added this feature. And it will be great if they add Bluetooth file share.

    Apple is not here. This is a user to user technical support forum. If you would like to share your thoughts with Apple, please do so here:
    Apple - Feedback
    Cheers,
    GB

  • Can I add animated GIFs to my project and Publish as HTML5?

    I've created several projects with Adobe Captivate 7 and have added animated GIFs to my project. When I publish, the GIF animations are only animated when played as SWF. When I play the HTML5 version the GIFs only show the first frame.
    Is there a way for me to publish my Adobe Captivate project so that the GIFs are animated when viewing the HTML5 output?

    HaridossR1234,
    Thank you for your reply. I have tried both draging-and-dropping the animation into the project as well as using the insert-> Animation menu option, but neither result in and animated GIF being displayed when the project is on the web and being viewed as an HTML5.
    I should note that the GIF IS animated when I view the project on my computer after publishing, but not when the project is displayed on my website. I publish the project with both GIF and SWF checked and Chrome displays the animated GIF but Firefox and Safari do not.
    When you say to check the HTML5 output, do you mean when I'm publishing the project as a whole or is there that option somewhere when I'm inserting the GIF?
    Sincerely,
    Lillie

  • What can I do to add animated gif to my Button

    hi everybody,
    I have a JButton, which is used as a 'search button'. I want my search button to show an animated globe gif when search is going on. I have my code as below.
    JButton searchButton = new JButton(MyUtilities.searchIcon());
    ImageIcon animatedGlobe = MyUtilities.animatedGlobeGif();
    searchButton.setPressedIcon(animatedGlobe );
    /*******************************************************/At runtime the button is showing a static globe which is not animating.
    I used to be tipped that I use Thread to make the picture moving ! So, can you show me the way !
    Quin
    (same idea on amar)

    Plug your iPod into iTunes and look under its Summary tab.  There should be a colored bar towards the bottom indicating how much of each of content you have synced to your iPod including music and podcasts, etc.
    If your music is taking up a majority of the space on your Shuffle, you might want to double check their format.  You can do this by right->clicking on a song and choosing Get Info.  When the window pops up for it you should be under a tab that gives the track's format.
    B-rock

  • Add animated GIF support in chats (for computer users)

    Support!

    I know that there's a post for getting GIFs availalble in the mobile section but I wanted to add it to the laptop/desktop section.  I think that being able to add GIFs just like if they were regular images would be a tremendous improvement to the IM system. 

  • Animated gif will not stop when placed in director

    I have an animated gif I am trying to place into a director
    file.
    When its placed and I press play it will play the animated
    gif over
    and over. I also took the gif and saved it as a swf file
    placed it in
    director it does the same thing. Please tell me what I am
    missing.
    Also I will show the dir file if you need to see it.

    Oops - wrong button - didn't mean to send that yet...
    anyway...
    You don't have much control over Animated Gif members in
    Director. You
    can use
    sprite(animGifSprite).pause()
    to stop the animation and
    sprite(animGifSprite).resume()
    to restart it. The tricky bit is knowing when to do those
    things.
    There is no way I know of to find out if the sprite is at the
    end of
    it's image sequence.
    Perhaps a better way of going about it would be to take the
    animation
    apart into individual frames and load them into a swf member
    (in Flash)
    or a Film Loop in Director. You may have more control over
    the
    animation that way.
    The fact that it keeps repeating over and over again is sort
    of the
    point of an animated gif... though I believe that you can
    make an
    animated gif that specifically does not loop back to the
    start using
    ImageReady or the newer version of Photoshop. Though I have
    not tried
    this...

  • Animated gifs -- broken feature; locked topic

    Hey -- what gives?
    Why is the main discussion in this forum of Mail's baffling inability to send an animated gif file been locked, with no further replies allowed?
    Is Apple so embarrassed at the absurdity of this simple feature being broken for so long that it can't bear to see any further discussion of the matter?
    I wanted to post that not even the "append selected file" workaround suggested within that thread worked on my machine (with the current 10.4.7 OS), and ask if any other users had any other suggestions. I also wanted to join the chorus of users who are saying: yes, this broken feature is a small thing -- which is precisely why Apple should have fixed it long ago.
    Meantime -- any user suggestions for what should be a simple, straightforward procedure?

    That thread certainly drifted off topic: it was not about sending animated GIF's in the first place but about receiving them in viewable form in Mail. The answer effectively was given: the feature apparently doesn't work for anyone, so it is currently broken. The remainder of the pots went off in several directions: how to send one, why would Apple break or not repair the view feature, when would they fix it, even some conjecture about philosophical reasons for & against having the feature at all.
    Some of these things are off limits for Apple Discussions because the terms of use prohibit them, others are threadjacks. As the moderator suggested, start a new post for "your issue" -- which still has to follow the terms, including not speculating on Apple policy or when a feature will be added/restored to its products.
    You topic & the subjects that you wanted to address in the locked one are only partially admissible under these terms. I suggest you steer clear of policy issues here & use there forums to determine if an issue is known or if a fix exists. Feature requests should instead be directed to Apple Feedback, conjecture to web sites & forums that allow or encourage that.
    For the technical aspects of your issue, it would help if you would outline what you have tried & how you have tested it.

  • Add web url to one frame of an animated gif?

    I have created an animated gif in Photoshop CS5 and want to add a url to one of the 3 frames as this gif is going on a website as a banner advert.
    I've read that I can use the slice tool to do this (?), but if so, I need help in laymans language as to how to do this. Or should I be doing it  a different way. I dont have fireworks, flash, illustrator etc, just photoshop cs5.
    The animated gif is for a website on a wordpress platform.
    Please help!
    Thank you.

    The Slice tool will divide an image into sections. These sections are not temporal, that is they cannot be time or frame based. They are physical structures, so you can make the bottom half have a URL displayed, and attach the HTML code to make that URL a clickable link. But this is all handled by HTML code. When you use the Slice Tool in combination with File > Save for Web and Devices, your output is not just the GIF file, but a full HTML web page that places the images (each slice will be a separate image file) so that it appears as a single image, with separate areas having URL link code attached.
    What you are trying to do, have a link attached to a single frame of animation within a GIF, is not possible. The GIF file format doesn't support anything like this, it does not support clickable links, nor does it support special behaviors per frame. Clickable links are entirely handled by HTML when it comes to image files. You would have to use Flash for something like this, but you would be creating an SWF, not a GIF. Fireworks and Illustrator would work the same as Photoshop in this regard.

  • How do I add an animated GIF to my signature

    I am trying to add an animated GIF to my out going email. For my signature. How can do this?

    Don't worry! Don't worry everyone I worked it out. Actually I just read the Mail support page segment on adding a signature. You just add a signature as usual but when you add the text, you can drag and adrop a pic/logo into that box. Ah, duh!

  • How do I add an animated gif to mail?

    How do I add an animated gif to mail and still have the animation active

    Dj
    I found this complete mail tutorial. Hope this will help you with unread messages.
    Regards,
    Joseph

  • Photoshop CS5, animated gif, how to add url to 1 frame.

    I have created an animated gif in Photoshop CS5 and want to embed a url to one of the 3 frames.
    How do I do this?
    I've read that I can use the slice tool to do this (?), but if so, I need help in laymans language as to how to do this.
    The animated gif is for a website on a wordpress platform. When this particular frame is clicked, it should link to the url which I want to add.
    Please help!
    Thank you.

    Whoops, sorry put this in the lightroom forum by mistake. Will post it in the PS CS5.

  • Animated GIFs on the web toolbar

    Hello,
    i understand that while deploying forms on the web, the toolbar
    uses gifs format files instead of icon file.
    if it takes gifs, i want to know whether it takes animated gifs,
    has anyone worked on this problem. i hope these is possible. i
    am not getting the right start, can any one you help
    thanks
    Vishnu Vadla
    null

    Matthew Kelton a écrit:
    This worked for me.  You did remember to register the OCX, correct?
    One problem I see is that it doesn't autosize and doesn't tell you what the size of the image is, so unless you know the size prior, you're goign to have to get the image attributes elsewhere.
    Message Edited by Matthew Kelton on 11-04-2007 01:44 AM
    Yes, I did (although not immediately... )
    How did you get the "AnimatedGif" automation refnum ?
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

Maybe you are looking for

  • Decimal after two digit in RTF

    HI, i want to print decimal after two digit i.e., 44 must be changed to 44.00 in .rtf I am able to print decimal after three and four digit i.e., 524 --> 524.00 , 6456 -->6456.00 I am using 0.00 format from BI PUBLISHER PROPERTY but not able to get d

  • STEPS TO INSTALL THE WINDOWS 7 WITH RECOVERY CD's FOR FRESH ONE

    I have Hp compaq Elite 8300 Desktop, in this system having pirated operating system but i want to replace it with original operating system and i had original recovery software CD's to. I am trying to install with the CD's but unable to intall please

  • My app store doesn't download anything i don't know how to fix this problem

    my app store doesn't download anything i don't know how to fix this problem

  • Problem when showing MS power point files on browser.

    Hi      I wrote the code in JSP to show MS power point files on browser. And I logged session for security as follow. <%@ page language = "java" import="javax.servlet.*, java.util.*, java.io.*" %> <%      String filename = request.getParameter("fileN

  • Ovi Calendar Repeats Data!! after latest update to...

    Guys, Has anyone had a problem with their calendar info after they layout has changed on their website? All my diarised appointments now repeat themselves everyday,they have well and truly cocked up my data. I see there have been updates regarding re