Bonjour
Je dois être crevé ce vendredi. Un problème idiot me freine. Je veux charger un BufferedImage dans mon mail:
Et oui, c'est pour un Splash Screen. Seulement, Java ne tolère pas cette construction:
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 public static void main(String[] args) { try { java.net.URL url = getClass().getResource("toto.png"); java.awt.image.BufferedImage im = javax.imageio.ImageIO.read(url); final SplashScreen window = new SplashScreen(im); window.setVisible(true); javax.swing.Timer timer = new javax.swing.Timer(5000, new ActionListener() { public void actionPerformed(ActionEvent evt) { window.setVisible(false); window.dispose(); } }); timer.start(); } catch (java.io.IOException e) { e.printStackTrace(); }
Comment faire ?
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2 Cannot make a static reference to the non-static method getClass() from the type Object
Merci d'avance
@++








Répondre avec citation



Partager