Results 1 to 6 of 6
  1. #1
    Kratos321's Avatar
    Kratos321 is offline Member
    Join Date
    May 2011
    Posts
    31
    Rep Power
    0

    Question How to add a .gif animation to an applet in JAVA?

    Hey, does anyone know how to add a .gif animation such as:
    http://smileys.papashome.com/images/happydance.gif


    to an applet in java with init() and paint() methods?

    thanks.

  2. #2
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default Re: How to add a .gif animation to an applet in JAVA?

    Are you looking for a way to draw the actual image manually using paintComponent, or just wish to display the animated gif? If the latter, create an ImageIcon of the image and add it to a JLabel...Swing will do the gif animation for you.

  3. #3
    Kratos321's Avatar
    Kratos321 is offline Member
    Join Date
    May 2011
    Posts
    31
    Rep Power
    0

    Default Re: How to add a .gif animation to an applet in JAVA?

    Actually no it didn't work. When I try to add the ImageIcon to the JLabel, it says no applicable overload..
    Last edited by Kratos321; 06-12-2012 at 12:50 AM.

  4. #4
    Kratos321's Avatar
    Kratos321 is offline Member
    Join Date
    May 2011
    Posts
    31
    Rep Power
    0

    Default Re: How to add a .gif animation to an applet in JAVA?

    Actually no it didn't work. When I try to add the ImageIcon to the JLabel, it says no applicable overload..

  5. #5
    doWhile is offline Moderator
    Join Date
    Jul 2010
    Location
    California
    Posts
    1,642
    Rep Power
    6

    Default Re: How to add a .gif animation to an applet in JAVA?

    Quote Originally Posted by Kratos321 View Post
    Actually no it didn't work. When I try to add the ImageIcon to the JLabel, it says no applicable overload..
    What says 'no applicable overload'?

  6. #6
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,450
    Rep Power
    18

    Default Re: How to add a .gif animation to an applet in JAVA?

    Clearly not the JLabel constructor.
    Please do not ask for code as refusal often offends.

Similar Threads

  1. Help with Applet and Animation
    By avsfan151933 in forum Java Applets
    Replies: 3
    Last Post: 11-12-2010, 02:24 AM
  2. Problem with my animation applet
    By cblue in forum Java 2D
    Replies: 0
    Last Post: 08-24-2009, 04:24 PM
  3. Replies: 3
    Last Post: 05-06-2009, 12:11 AM
  4. Animation Applet
    By Unome in forum Java Applets
    Replies: 7
    Last Post: 10-17-2008, 07:34 AM
  5. Applet Vs JApplet ?? which is better for animation?
    By Mba7eth in forum New To Java
    Replies: 3
    Last Post: 09-09-2008, 04:55 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •