J ai envi d'afficher une image,et que cette image disparaisse au bout de x seconde puis s'affiche un jfilechooser,continuer son code quoi

En gros,je desirerais que l'image reste à l'écran avant de faire le thread.sleep,il y a bien une fenetre qui se lance mais aucune image...

Voici mon code

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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
 
/*
 * fenetre.java
 *
 * Created on 24 juin 2006, 14:40
 */
 
package projet;
 
/**
 *
 * @author  sylv1
 */
public class fenetre extends javax.swing.JFrame {
 
    /** Creates new form fenetre */
    public fenetre() {
        initComponents();
 
    }
 
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {
        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
 
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        jLabel1.setIcon(new javax.swing.ImageIcon("C:\\Documents and Settings\\sylv1\\Mes documents\\Mes images\\AR0272-1.jpg"));
        jLabel1.setText("jLabel1");
 
        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(21, 21, 21)
                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 377, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(41, Short.MAX_VALUE))
            .add(org.jdesktop.layout.GroupLayout.TRAILING, layout.createSequentialGroup()
                .addContainerGap(204, Short.MAX_VALUE)
                .add(jButton1)
                .add(202, 202, 202))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .add(32, 32, 32)
                .add(jLabel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 256, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jButton1)
                .addContainerGap(43, Short.MAX_VALUE))
        );
        pack();
    }// </editor-fold>//GEN-END:initComponents
 
    /**
     * @param args the command line arguments
     */
 
 
            public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {           
            public void run() {
                 fenetre f=new fenetre();
                 f.setSize(600,450);
                f.setVisible(true);
                f.repaint();
 
           Object o=new Object();
try
{
    synchronized(o) { o.wait(4000);f.dispose();    }
}
catch(InterruptedException ex) { }
JMyFileChooser j=new JMyFileChooser();
 
         //       try{
            //      Thread.sleep(4000); 
                  //  f.dispose();
         //  f.dispose();      
         //  JMyFileChooser j=new JMyFileChooser();
 
 
       //         }catch(InterruptedException e){e.printStackTrace();}
            }
        });
    }
 
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration//GEN-END:variables
 
}