je sais que la question a été posé dans les forums mais les solutions testées ne m'ont pas données satisfaction.
j'ai donc une jolie classe java SplashScreen se trouvant ci dessous, étant la copie conforme du code se trouvant ici :http://java.developpez.com/sources/?...ngSplashScreen
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
/*
 * SplashScreen.java
 *
 * Created on 23 mai 2007, 12:25
 *
 * To change this template, choose Tools | Template Manager
 * and open the template in the editor.
 */
 
package projetifm;
 
import javax.swing.JWindow; 
import java.awt.*; 
import java.awt.image.*; 
import javax.imageio.*; 
import java.net.*; 
import java.io.*; 
import java.util.*; 
 
public class SplashScreen extends JWindow
{
	private BufferedImage image; 
	public SplashScreen(String file, long time)
        {
		super();
 
		URL url = getClass().getResource(file);
		try
                {
                        image = ImageIO.read(url);
			setSize(new Dimension(image.getWidth(), image.getHeight()));
			setLocationRelativeTo(null);
			setAlwaysOnTop(true);
			setVisible(true);
		}
                catch(IOException ioe)
                {
                    System.out.println(ioe.getMessage());
                }
		if(time>0)
                {
			TimerTask dispose = new TimerTask()
                        {
				public void run(){dispose();}	
			};
			Timer timer = new Timer();
			timer.schedule(dispose, time);
			try
                        {
				Thread.sleep(time);
			}
                        catch(Exception e){e.printStackTrace();}
		}
	}
	public SplashScreen(String file)
        {
		this(file,0);	
	}
	public void paint(Graphics g)
        {
		if(image.getColorModel().hasAlpha()){
			try
                        {
				Robot robot = new Robot();
				BufferedImage fond = robot.createScreenCapture(getBounds());
				MediaTracker tracker = new MediaTracker(this);
				tracker.addImage(fond,0);
				tracker.waitForAll();
				g.drawImage(fond, 0,0,null);
			}
                        catch(Exception e){e.printStackTrace();}
		}
		g.drawImage(image,0,0,null);	
	}
}

je lance mon splash avec ceci :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
SplashScreen splash_photo = new SplashScreen("img/loading.gif");
Mais ceci ne m'affiche qu'un cadre blanc...
D'où viendrait l'erreur je ne comprend pas trop?