J'utilise une class pour faire un drag/drop de fichier.
A chaque fois qu'on ajoute un fichier je voudrais créer un JLabel.
voici le 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
 
              new FileDrop(filesList, this.iniFile, text, dragBorder, new FileDrop.Listener()            {   
                public void filesDropped( java.io.File[] files )
                    {   for( int i = 0; i < files.length; i++ )
                        {   text.append( files[i].getName() + "\n" );
 
                            String[] item = {files[i].getAbsolutePath(),iniFile.getProperty(files[i].getName().substring(0, files[i].getName().lastIndexOf("-")))};
                            filesList[i] = item;
 
                            //addinfo(panRight,iniFile.getProperty(files[i].getName().substring(0, files[i].getName().lastIndexOf("-"))));
                            panRight.add(new JLabel("fsdfsd"));
 
 
 
                            //text.setBorder(new javax.swing.border.TitledBorder("Dropbox pour les fichiers ("+files.length+")"));
                            logger.info(iniFile.getProperty(files[i].getName().substring(0, files[i].getName().lastIndexOf("-"))));
                        }
                    }
            });
Pourquoi mon JLabel ne s'ajoute pas a panRight
merci d'avance pour votre aide !