Add .gif image as icon to the output window












2















I want to add a loading animated gif icon to the output window of my NetBeans platform application that I am developing. I managed to add a png icon file. But in this case, the gif icon added is not animating. it stays the same.



private class Loading extends AbstractAction {

public Loading() {
//putValue(SMALL_ICON, ImageUtilities.loadImageIcon("org/netbeans/modules/plsql/execution/loading.gif", true));

putValue(SMALL_ICON, ImageUtilities.loadImage("org/netbeans/modules/plsql/execution/loading.gif",true));
}

@Override
public void actionPerformed(ActionEvent e) {
System.out.println("Action performed");
}

}


This is what I used as the output window.



final InputOutput io = IOProvider.getDefault().getIO("Deploy Dependents", new Action{new Loading()});


To the image that is circled here










share|improve this question

























  • Have you tried to use ImageIcon like in this answer: stackoverflow.com/a/42284050/150978?

    – Robert
    Jan 5 at 14:30













  • @Robert yes I did. The was shown in the correct place but it did not animated and stayed still.

    – Gihan Saranga Siriwardhana
    Jan 6 at 1:10
















2















I want to add a loading animated gif icon to the output window of my NetBeans platform application that I am developing. I managed to add a png icon file. But in this case, the gif icon added is not animating. it stays the same.



private class Loading extends AbstractAction {

public Loading() {
//putValue(SMALL_ICON, ImageUtilities.loadImageIcon("org/netbeans/modules/plsql/execution/loading.gif", true));

putValue(SMALL_ICON, ImageUtilities.loadImage("org/netbeans/modules/plsql/execution/loading.gif",true));
}

@Override
public void actionPerformed(ActionEvent e) {
System.out.println("Action performed");
}

}


This is what I used as the output window.



final InputOutput io = IOProvider.getDefault().getIO("Deploy Dependents", new Action{new Loading()});


To the image that is circled here










share|improve this question

























  • Have you tried to use ImageIcon like in this answer: stackoverflow.com/a/42284050/150978?

    – Robert
    Jan 5 at 14:30













  • @Robert yes I did. The was shown in the correct place but it did not animated and stayed still.

    – Gihan Saranga Siriwardhana
    Jan 6 at 1:10














2












2








2








I want to add a loading animated gif icon to the output window of my NetBeans platform application that I am developing. I managed to add a png icon file. But in this case, the gif icon added is not animating. it stays the same.



private class Loading extends AbstractAction {

public Loading() {
//putValue(SMALL_ICON, ImageUtilities.loadImageIcon("org/netbeans/modules/plsql/execution/loading.gif", true));

putValue(SMALL_ICON, ImageUtilities.loadImage("org/netbeans/modules/plsql/execution/loading.gif",true));
}

@Override
public void actionPerformed(ActionEvent e) {
System.out.println("Action performed");
}

}


This is what I used as the output window.



final InputOutput io = IOProvider.getDefault().getIO("Deploy Dependents", new Action{new Loading()});


To the image that is circled here










share|improve this question
















I want to add a loading animated gif icon to the output window of my NetBeans platform application that I am developing. I managed to add a png icon file. But in this case, the gif icon added is not animating. it stays the same.



private class Loading extends AbstractAction {

public Loading() {
//putValue(SMALL_ICON, ImageUtilities.loadImageIcon("org/netbeans/modules/plsql/execution/loading.gif", true));

putValue(SMALL_ICON, ImageUtilities.loadImage("org/netbeans/modules/plsql/execution/loading.gif",true));
}

@Override
public void actionPerformed(ActionEvent e) {
System.out.println("Action performed");
}

}


This is what I used as the output window.



final InputOutput io = IOProvider.getDefault().getIO("Deploy Dependents", new Action{new Loading()});


To the image that is circled here







java icons output animated-gif netbeans-platform






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 6:11







Gihan Saranga Siriwardhana

















asked Dec 25 '18 at 9:30









Gihan Saranga SiriwardhanaGihan Saranga Siriwardhana

625424




625424













  • Have you tried to use ImageIcon like in this answer: stackoverflow.com/a/42284050/150978?

    – Robert
    Jan 5 at 14:30













  • @Robert yes I did. The was shown in the correct place but it did not animated and stayed still.

    – Gihan Saranga Siriwardhana
    Jan 6 at 1:10



















  • Have you tried to use ImageIcon like in this answer: stackoverflow.com/a/42284050/150978?

    – Robert
    Jan 5 at 14:30













  • @Robert yes I did. The was shown in the correct place but it did not animated and stayed still.

    – Gihan Saranga Siriwardhana
    Jan 6 at 1:10

















Have you tried to use ImageIcon like in this answer: stackoverflow.com/a/42284050/150978?

– Robert
Jan 5 at 14:30







Have you tried to use ImageIcon like in this answer: stackoverflow.com/a/42284050/150978?

– Robert
Jan 5 at 14:30















@Robert yes I did. The was shown in the correct place but it did not animated and stayed still.

– Gihan Saranga Siriwardhana
Jan 6 at 1:10





@Robert yes I did. The was shown in the correct place but it did not animated and stayed still.

– Gihan Saranga Siriwardhana
Jan 6 at 1:10












2 Answers
2






active

oldest

votes


















1





+50









You need to add the button as the ImageObserver of the Image you loaded with ImageUtilities.loadImage(). It will take care of the animation for you.



Access to the button itself might be hidden by the IOProvider class but if you manage to get a handle on it, just call image.setImageObserver(button) and you'll see the animation running.






share|improve this answer































    0














    you can try below code, it is loading gif image with animation.



    I think you need only this part of the code:



        ClassLoader classLoader = getClass().getClassLoader();
    File file = new File(classLoader.getResource("gif.gif").getFile());
    Image image = Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.toByteArray(new FileInputStream(file)));
    ImageIcon icon = new ImageIcon(image);


    Full code example added below:



    import java.awt.Image;
    import java.awt.Toolkit;
    import java.io.File;
    import java.io.FileInputStream;

    import javax.swing.ImageIcon;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.SwingUtilities;

    public class AnimationTest extends JFrame {

    public static void main(String args) {
    SwingUtilities.invokeLater(new Runnable() {
    public void run() {
    AnimationTest test = new AnimationTest();
    test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    test.setVisible(true);
    }
    });
    }

    public AnimationTest() {
    super();
    try {
    JLabel label = new JLabel();
    ClassLoader classLoader = getClass().getClassLoader();
    File file = new File(classLoader.getResource("gif.gif").getFile());
    Image image =
    Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.
    toByteArray(new FileInputStream(file)));
    ImageIcon icon = new ImageIcon(image);
    label.setIcon(icon);
    icon.setImageObserver(label);
    add(label);
    pack();
    } catch (Exception e) {
    e.printStackTrace();
    }
    }


    }



    added same code with jave project to github, you can get full code from there.



    loading gif image to java with animation



    Additionally, you need to use below apache commons dependency for the sample code



        <dependency>
    <groupId>commons-io</groupId>
    <artifactId>commons-io</artifactId>
    <version>2.6</version>
    </dependency>





    share|improve this answer
























    • This is not actually what I am looking for. I want to add a gif animation to the output window tab

      – Gihan Saranga Siriwardhana
      Jan 2 at 3:05











    • what you mean by output window tab? can you share the full code sample? anyway if you want to gif animate, you need to load as stream and make it to the imageIcon.

      – Dilanka M
      Jan 2 at 3:50








    • 1





      your question is still not clear. I suggest you to provide your code for ImageUtilities.loadImage(..) and IOProvider.getDefault().getIO(..) related methods. because without that it is not possible to try.

      – Dilanka M
      Jan 2 at 10:53











    • I know how to add an image. That's not my problem. If you read the question again, my question was that the image I added was not animating even though it was an animated Gif. And I have provided all the necessary codes

      – Gihan Saranga Siriwardhana
      Jan 2 at 11:23






    • 1





      ButtonUI didn't support annimated image rather than label; if you try Dilanka's code you will see. that the easyest way is to do what you whant create a label that will be listenning MouseEvent to perform the action

      – Arnault Le Prévost-Corvellec
      Jan 3 at 15:29











    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53921054%2fadd-gif-image-as-icon-to-the-output-window%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1





    +50









    You need to add the button as the ImageObserver of the Image you loaded with ImageUtilities.loadImage(). It will take care of the animation for you.



    Access to the button itself might be hidden by the IOProvider class but if you manage to get a handle on it, just call image.setImageObserver(button) and you'll see the animation running.






    share|improve this answer




























      1





      +50









      You need to add the button as the ImageObserver of the Image you loaded with ImageUtilities.loadImage(). It will take care of the animation for you.



      Access to the button itself might be hidden by the IOProvider class but if you manage to get a handle on it, just call image.setImageObserver(button) and you'll see the animation running.






      share|improve this answer


























        1





        +50







        1





        +50



        1




        +50





        You need to add the button as the ImageObserver of the Image you loaded with ImageUtilities.loadImage(). It will take care of the animation for you.



        Access to the button itself might be hidden by the IOProvider class but if you manage to get a handle on it, just call image.setImageObserver(button) and you'll see the animation running.






        share|improve this answer













        You need to add the button as the ImageObserver of the Image you loaded with ImageUtilities.loadImage(). It will take care of the animation for you.



        Access to the button itself might be hidden by the IOProvider class but if you manage to get a handle on it, just call image.setImageObserver(button) and you'll see the animation running.







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Jan 6 at 1:36









        MatthieuMatthieu

        17923667




        17923667

























            0














            you can try below code, it is loading gif image with animation.



            I think you need only this part of the code:



                ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("gif.gif").getFile());
            Image image = Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.toByteArray(new FileInputStream(file)));
            ImageIcon icon = new ImageIcon(image);


            Full code example added below:



            import java.awt.Image;
            import java.awt.Toolkit;
            import java.io.File;
            import java.io.FileInputStream;

            import javax.swing.ImageIcon;
            import javax.swing.JFrame;
            import javax.swing.JLabel;
            import javax.swing.SwingUtilities;

            public class AnimationTest extends JFrame {

            public static void main(String args) {
            SwingUtilities.invokeLater(new Runnable() {
            public void run() {
            AnimationTest test = new AnimationTest();
            test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            test.setVisible(true);
            }
            });
            }

            public AnimationTest() {
            super();
            try {
            JLabel label = new JLabel();
            ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("gif.gif").getFile());
            Image image =
            Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.
            toByteArray(new FileInputStream(file)));
            ImageIcon icon = new ImageIcon(image);
            label.setIcon(icon);
            icon.setImageObserver(label);
            add(label);
            pack();
            } catch (Exception e) {
            e.printStackTrace();
            }
            }


            }



            added same code with jave project to github, you can get full code from there.



            loading gif image to java with animation



            Additionally, you need to use below apache commons dependency for the sample code



                <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
            </dependency>





            share|improve this answer
























            • This is not actually what I am looking for. I want to add a gif animation to the output window tab

              – Gihan Saranga Siriwardhana
              Jan 2 at 3:05











            • what you mean by output window tab? can you share the full code sample? anyway if you want to gif animate, you need to load as stream and make it to the imageIcon.

              – Dilanka M
              Jan 2 at 3:50








            • 1





              your question is still not clear. I suggest you to provide your code for ImageUtilities.loadImage(..) and IOProvider.getDefault().getIO(..) related methods. because without that it is not possible to try.

              – Dilanka M
              Jan 2 at 10:53











            • I know how to add an image. That's not my problem. If you read the question again, my question was that the image I added was not animating even though it was an animated Gif. And I have provided all the necessary codes

              – Gihan Saranga Siriwardhana
              Jan 2 at 11:23






            • 1





              ButtonUI didn't support annimated image rather than label; if you try Dilanka's code you will see. that the easyest way is to do what you whant create a label that will be listenning MouseEvent to perform the action

              – Arnault Le Prévost-Corvellec
              Jan 3 at 15:29
















            0














            you can try below code, it is loading gif image with animation.



            I think you need only this part of the code:



                ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("gif.gif").getFile());
            Image image = Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.toByteArray(new FileInputStream(file)));
            ImageIcon icon = new ImageIcon(image);


            Full code example added below:



            import java.awt.Image;
            import java.awt.Toolkit;
            import java.io.File;
            import java.io.FileInputStream;

            import javax.swing.ImageIcon;
            import javax.swing.JFrame;
            import javax.swing.JLabel;
            import javax.swing.SwingUtilities;

            public class AnimationTest extends JFrame {

            public static void main(String args) {
            SwingUtilities.invokeLater(new Runnable() {
            public void run() {
            AnimationTest test = new AnimationTest();
            test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            test.setVisible(true);
            }
            });
            }

            public AnimationTest() {
            super();
            try {
            JLabel label = new JLabel();
            ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("gif.gif").getFile());
            Image image =
            Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.
            toByteArray(new FileInputStream(file)));
            ImageIcon icon = new ImageIcon(image);
            label.setIcon(icon);
            icon.setImageObserver(label);
            add(label);
            pack();
            } catch (Exception e) {
            e.printStackTrace();
            }
            }


            }



            added same code with jave project to github, you can get full code from there.



            loading gif image to java with animation



            Additionally, you need to use below apache commons dependency for the sample code



                <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
            </dependency>





            share|improve this answer
























            • This is not actually what I am looking for. I want to add a gif animation to the output window tab

              – Gihan Saranga Siriwardhana
              Jan 2 at 3:05











            • what you mean by output window tab? can you share the full code sample? anyway if you want to gif animate, you need to load as stream and make it to the imageIcon.

              – Dilanka M
              Jan 2 at 3:50








            • 1





              your question is still not clear. I suggest you to provide your code for ImageUtilities.loadImage(..) and IOProvider.getDefault().getIO(..) related methods. because without that it is not possible to try.

              – Dilanka M
              Jan 2 at 10:53











            • I know how to add an image. That's not my problem. If you read the question again, my question was that the image I added was not animating even though it was an animated Gif. And I have provided all the necessary codes

              – Gihan Saranga Siriwardhana
              Jan 2 at 11:23






            • 1





              ButtonUI didn't support annimated image rather than label; if you try Dilanka's code you will see. that the easyest way is to do what you whant create a label that will be listenning MouseEvent to perform the action

              – Arnault Le Prévost-Corvellec
              Jan 3 at 15:29














            0












            0








            0







            you can try below code, it is loading gif image with animation.



            I think you need only this part of the code:



                ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("gif.gif").getFile());
            Image image = Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.toByteArray(new FileInputStream(file)));
            ImageIcon icon = new ImageIcon(image);


            Full code example added below:



            import java.awt.Image;
            import java.awt.Toolkit;
            import java.io.File;
            import java.io.FileInputStream;

            import javax.swing.ImageIcon;
            import javax.swing.JFrame;
            import javax.swing.JLabel;
            import javax.swing.SwingUtilities;

            public class AnimationTest extends JFrame {

            public static void main(String args) {
            SwingUtilities.invokeLater(new Runnable() {
            public void run() {
            AnimationTest test = new AnimationTest();
            test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            test.setVisible(true);
            }
            });
            }

            public AnimationTest() {
            super();
            try {
            JLabel label = new JLabel();
            ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("gif.gif").getFile());
            Image image =
            Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.
            toByteArray(new FileInputStream(file)));
            ImageIcon icon = new ImageIcon(image);
            label.setIcon(icon);
            icon.setImageObserver(label);
            add(label);
            pack();
            } catch (Exception e) {
            e.printStackTrace();
            }
            }


            }



            added same code with jave project to github, you can get full code from there.



            loading gif image to java with animation



            Additionally, you need to use below apache commons dependency for the sample code



                <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
            </dependency>





            share|improve this answer













            you can try below code, it is loading gif image with animation.



            I think you need only this part of the code:



                ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("gif.gif").getFile());
            Image image = Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.toByteArray(new FileInputStream(file)));
            ImageIcon icon = new ImageIcon(image);


            Full code example added below:



            import java.awt.Image;
            import java.awt.Toolkit;
            import java.io.File;
            import java.io.FileInputStream;

            import javax.swing.ImageIcon;
            import javax.swing.JFrame;
            import javax.swing.JLabel;
            import javax.swing.SwingUtilities;

            public class AnimationTest extends JFrame {

            public static void main(String args) {
            SwingUtilities.invokeLater(new Runnable() {
            public void run() {
            AnimationTest test = new AnimationTest();
            test.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            test.setVisible(true);
            }
            });
            }

            public AnimationTest() {
            super();
            try {
            JLabel label = new JLabel();
            ClassLoader classLoader = getClass().getClassLoader();
            File file = new File(classLoader.getResource("gif.gif").getFile());
            Image image =
            Toolkit.getDefaultToolkit().createImage(org.apache.commons.io.IOUtils.
            toByteArray(new FileInputStream(file)));
            ImageIcon icon = new ImageIcon(image);
            label.setIcon(icon);
            icon.setImageObserver(label);
            add(label);
            pack();
            } catch (Exception e) {
            e.printStackTrace();
            }
            }


            }



            added same code with jave project to github, you can get full code from there.



            loading gif image to java with animation



            Additionally, you need to use below apache commons dependency for the sample code



                <dependency>
            <groupId>commons-io</groupId>
            <artifactId>commons-io</artifactId>
            <version>2.6</version>
            </dependency>






            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jan 1 at 7:10









            Dilanka MDilanka M

            9219




            9219













            • This is not actually what I am looking for. I want to add a gif animation to the output window tab

              – Gihan Saranga Siriwardhana
              Jan 2 at 3:05











            • what you mean by output window tab? can you share the full code sample? anyway if you want to gif animate, you need to load as stream and make it to the imageIcon.

              – Dilanka M
              Jan 2 at 3:50








            • 1





              your question is still not clear. I suggest you to provide your code for ImageUtilities.loadImage(..) and IOProvider.getDefault().getIO(..) related methods. because without that it is not possible to try.

              – Dilanka M
              Jan 2 at 10:53











            • I know how to add an image. That's not my problem. If you read the question again, my question was that the image I added was not animating even though it was an animated Gif. And I have provided all the necessary codes

              – Gihan Saranga Siriwardhana
              Jan 2 at 11:23






            • 1





              ButtonUI didn't support annimated image rather than label; if you try Dilanka's code you will see. that the easyest way is to do what you whant create a label that will be listenning MouseEvent to perform the action

              – Arnault Le Prévost-Corvellec
              Jan 3 at 15:29



















            • This is not actually what I am looking for. I want to add a gif animation to the output window tab

              – Gihan Saranga Siriwardhana
              Jan 2 at 3:05











            • what you mean by output window tab? can you share the full code sample? anyway if you want to gif animate, you need to load as stream and make it to the imageIcon.

              – Dilanka M
              Jan 2 at 3:50








            • 1





              your question is still not clear. I suggest you to provide your code for ImageUtilities.loadImage(..) and IOProvider.getDefault().getIO(..) related methods. because without that it is not possible to try.

              – Dilanka M
              Jan 2 at 10:53











            • I know how to add an image. That's not my problem. If you read the question again, my question was that the image I added was not animating even though it was an animated Gif. And I have provided all the necessary codes

              – Gihan Saranga Siriwardhana
              Jan 2 at 11:23






            • 1





              ButtonUI didn't support annimated image rather than label; if you try Dilanka's code you will see. that the easyest way is to do what you whant create a label that will be listenning MouseEvent to perform the action

              – Arnault Le Prévost-Corvellec
              Jan 3 at 15:29

















            This is not actually what I am looking for. I want to add a gif animation to the output window tab

            – Gihan Saranga Siriwardhana
            Jan 2 at 3:05





            This is not actually what I am looking for. I want to add a gif animation to the output window tab

            – Gihan Saranga Siriwardhana
            Jan 2 at 3:05













            what you mean by output window tab? can you share the full code sample? anyway if you want to gif animate, you need to load as stream and make it to the imageIcon.

            – Dilanka M
            Jan 2 at 3:50







            what you mean by output window tab? can you share the full code sample? anyway if you want to gif animate, you need to load as stream and make it to the imageIcon.

            – Dilanka M
            Jan 2 at 3:50






            1




            1





            your question is still not clear. I suggest you to provide your code for ImageUtilities.loadImage(..) and IOProvider.getDefault().getIO(..) related methods. because without that it is not possible to try.

            – Dilanka M
            Jan 2 at 10:53





            your question is still not clear. I suggest you to provide your code for ImageUtilities.loadImage(..) and IOProvider.getDefault().getIO(..) related methods. because without that it is not possible to try.

            – Dilanka M
            Jan 2 at 10:53













            I know how to add an image. That's not my problem. If you read the question again, my question was that the image I added was not animating even though it was an animated Gif. And I have provided all the necessary codes

            – Gihan Saranga Siriwardhana
            Jan 2 at 11:23





            I know how to add an image. That's not my problem. If you read the question again, my question was that the image I added was not animating even though it was an animated Gif. And I have provided all the necessary codes

            – Gihan Saranga Siriwardhana
            Jan 2 at 11:23




            1




            1





            ButtonUI didn't support annimated image rather than label; if you try Dilanka's code you will see. that the easyest way is to do what you whant create a label that will be listenning MouseEvent to perform the action

            – Arnault Le Prévost-Corvellec
            Jan 3 at 15:29





            ButtonUI didn't support annimated image rather than label; if you try Dilanka's code you will see. that the easyest way is to do what you whant create a label that will be listenning MouseEvent to perform the action

            – Arnault Le Prévost-Corvellec
            Jan 3 at 15:29


















            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53921054%2fadd-gif-image-as-icon-to-the-output-window%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            MongoDB - Not Authorized To Execute Command

            How to fix TextFormField cause rebuild widget in Flutter

            in spring boot 2.1 many test slices are not allowed anymore due to multiple @BootstrapWith