在我的 JFrame
的覆盖函数中:
@Override
protected void paintComponent(Graphics g) {
BufferedImage imagePerson;
try {
imagePerson = ImageIO.read(new File("errol.gif"));
} catch (IOException e) {
imagePerson = null;
}
g.drawImage(imagePerson, i * increment, j * increment - 1, null);
}
我如何更改它以便显示 gif 上的动画(不使用线程)。我花了很多时间试图让它工作但无济于事。
最佳答案
关于java - 在 jPanel 上显示动画 gif,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4339029/