Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8610509
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T04:08:52+00:00 2026-06-12T04:08:52+00:00

I am trying to put a .gif image on a label. The image loads

  • 0

I am trying to put a “.gif” image on a label. The image loads , but it is static (no animation). Any guesses why? and how to solve it?

Code that I am using:

BufferedImage img1=ImageIO.read(TCPServer.class.getResource("filecopy.gif"));
JLabel filetransferpic = new JLabel(new ImageIcon(img1));

Note: I don’t want to use..

JLabel filetransferpic = new JLabel(new ImageIcon("G:\\filecopy.gif")); 

..approach. Because in this approach I will have to give drive path and place the image in drive. I want the image in project folder “src”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T04:08:54+00:00Added an answer on June 12, 2026 at 4:08 am

    In your example, you are using a BufferedImage. Instead, use an ImageIcon, like this:

    ImageIcon gifImage = new ImageIcon(new URL("file:/Path/To/file.gif"));
    JLabel yourLabel = new JLabel(gifImage);
    

    This should be animated. But remember, the constructor URL(String) throws a MalformedURLException; make sure to catch it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to put together a layout using Bootstrap that resembles your typical OS
i am trying to put context path for an image in HTML. <img src=/MyWeb/images/pageSetup.gif>
I am trying to load .gif image from external storage (pictures directory) but I
Trying to put a regex expression together that returns the string between _ and
I trying to put together an Android app that will take a picture and
I am trying to put a background to a empty anchor tag, but nothing
Trying to put in field pagar the calculated value of precio * 15% but
How can I set as a default image a gif, via css. I'm trying
I am trying to write a unit test for a multipart PUT using Symfony2
I'm trying to do something that seems like it should be easy but I'm

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.