Loading animated GIF in JLabel weirdness

前端 未结 3 672
清歌不尽
清歌不尽 2021-01-13 00:13

I\'m trying to load an animated GIF in a JLabel.

While this works:

URL urlsd;
try {
    urlsd = new URL(\"http://pscode.org/media/starzoom-thumb.gif\         


        
3条回答
  •  醉梦人生
    2021-01-13 00:54

    So there is also a simpler way of doing it. The following line is how I did it.

    this.setContentPane(new JLabel(new ImageIcon("Path To Gif File")));
    

提交回复
热议问题