Re: Animated GIF display in JFrame vs. JApplet



"Daniele Futtorovic" <da.futt.news@xxxxxxxxxxxxxxx> wrote in message news:g3repq$b9u$1@xxxxxxxxxxxxxxxxxxxxxxxxxxxx
On 2008-06-24 14:17 +0100, Qu0ll allegedly wrote:
I have an animated GIF which I would like to display in all its animated glory in a JFrame based application and in a JApplet. The GIF animates when displayed in the JFrame by using the paintIcon() method of ImageIcon but the same code only displays a static icon in the applet.

Is there a reason for this and/or a way to get it to work in the applet? I am not trying to do anything sophisticated with it just yet, I simply create a JPanel and override its paintComponent() method to paint the ImageIcon. As I said, it works fine when the JPanel is in a JFrame but not in a JApplet.


Simply put your Icon in a JLabel. Shouldn't be necessary to interfere
with paintComponent() at all.

This MAY solve your problem.

Thanks but it just doesn't want to animate inside an applet even when in a JLabel :-(

--
And loving it,

-Qu0ll (Rare, not extinct)
_________________________________________________
Qu0llSixFour@xxxxxxxxx
[Replace the "SixFour" with numbers to email me]

.



Relevant Pages

  • Re: Two basic questions considering Swing
    ... If you do not want an applet, extend ... > error is caused by the fact that it is an applet. ... The example from the tutorial also extends JPanel, not JApplet, I didn't notice ... But if I use a JFrame then I won't be able to put my application in a browser, ...
    (comp.lang.java.help)
  • Why doesnt this work?
    ... as an application that displays in a frame, ... when I try to run it as an applet. ... content pane the layouts are drawn on from a JFrame to a JApplet. ...
    (comp.lang.java.programmer)
  • Re: JFrame as JApplet?
    ... be run as well as a JFrame as as a JApplet. ... My notes tell me that I got the above from some Sun article, but I can't find the original article at the moment. ... Maybe you probably better use Sun's AppletViewer to run the applet as an application. ...
    (comp.lang.java.gui)
  • Re: Two basic questions considering Swing
    ... If you do not want an applet, extend ... >> error is caused by the fact that it is an applet. ... > JPanel, not JApplet, I didn't notice that. ... But if I use a JFrame then I ...
    (comp.lang.java.help)
  • Re: opening a window from an applet..
    ... (public class extends JFrame?) ... if it's a JFrame instead of an applet does it still have to have initmethod? ... (can I open a swing window from an applet? ... Which is a frame like any other. ...
    (comp.lang.java.gui)