Today I checked to show gif with java splashscreen option. This works, but ... When repeating the splash screen, my gif shows a strange graphic error ...

This error appears only in a Java application.
This is the original gif:

Code
public class Bootstrap {
private SplashScreen splash;
public static void main(String[] args) {
Bootstrap bootstrap = new Bootstrap();
bootstrap.start();
}
public void start() {
splash = new SplashScreen("UC", new ImageIcon(getClass().getResource("splash3.gif")).getImage());
AWTUtilities.setWindowOpaque(splash, false);
splash.setVisible(true);
}
}
SplashScreen.java
public class SplashScreen extends JFrame {
public SplashScreen(String title, Image image) {
this.setTitle(title);
this.setUndecorated(true);
this.setDefaultCloseOperation(3);
this.setSize(image.getWidth(this), image.getHeight(this));
this.setLocationRelativeTo((Component)null);
this.setContentPane(new SplashPanel(image));
}
}
Splashpanel.java
class SplashPanel extends JPanel {
private Image image;
public SplashPanel(Image image) {
this.image = image;
}
public void paintComponent(Graphics g) {
g.drawImage(this.image, 0, 0, this.getWidth(), this.getHeight(), this);
}
}
Apparently, this is simply because the gif is interlaced. :) Just uncheck this when you export the gif from Photoshop ... :)
source
share