Hoo*_*lum 5 java animation swing jlabel animated-gif
这个特定的GIF动画播放速度太快,比正常速度快100倍.有没有解决这个问题?或者我应该进一步减慢"GIF的正常速度"?
public class Test {
private static final String url = "http://i.stack.imgur.com/AnrWw.gif";
private void display() throws MalformedURLException {
JFrame f = new JFrame("Test");
f.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
f.add(new JLabel(new ImageIcon(new URL(url))));
f.pack();
f.setLocationRelativeTo(null);
f.setVisible(true);
}
public static void main(String[] args) {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
try {
new Test().display();
} catch (MalformedURLException ex) {
ex.printStackTrace(System.err);
}
}
});
}
}
Run Code Online (Sandbox Code Playgroud)