i was trying to put a Gif image to simule "Loading" in a JOptionPane with no results. I tryied with URL, with a Local image, with an absolute path to image but i am only able to put an image (png, jpg...) inside of it. My last try is this
final ImageIcon icon = new ImageIcon(new URL("http://www.archisevilla.org/wp-content/themes/archisevilla/images/loading.gif"));
JOptionPane.showMessageDialog(null, "Cerrando sesión...", "About", JOptionPane.INFORMATION_MESSAGE, icon);
The JOptionPane image's placeholder looks empty when i run this code.
So i wonder: is possible to put a GIF in a JOptionPane, or even in a JFrame?
This is the code i'm using
private void cerrarsesion() throws Exception {
this.dispose();
String path = "/com/icono/loading.gif";
URL url = this.getClass().getResource(path);
System.out.println(url);
ImageIcon icon = new ImageIcon(url);
createTimerClose(10).start();
JOptionPane.showMessageDialog(null, "Cerrando sesión...", "About", JOptionPane.INFORMATION_MESSAGE, icon);
new Login().setVisible(true);
}