IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

 Java Discussion :

Connaissance générale en java pour les reférences


Sujet :

Java

  1. #1
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Décembre 2016
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Décembre 2016
    Messages : 19
    Points : 20
    Points
    20
    Par défaut Connaissance générale en java pour les reférences
    S'il vous plait comment je voudrais utiliser une référence à une classe externe de la classe mère dans la methode main()
    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
    public class Fenetre3 extends javax.swing.JFrame {
     
     Exemple ex;
     
     
        public Fenetre3(Exemple ex1) {
          this.ex=ex1;}
     
     public static void main(String args[]) {
     
            /* Set the Nimbus look and feel */
            //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
            /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
             * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
             */
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(Fenetre3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(Fenetre3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(Fenetre3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(Fenetre3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
     
            /* Create and display the form */
            java.awt.EventQueue.invokeLater(new Runnable() {
     
                public void run() {
     
                    new Fenetre3(/*   */).setVisible(false);
     
                  SplashJDialog splash = new SplashJDialog(new Fenetre3(/*   */));
     
     
                  (new Thread(splash)).start();
                }
            });
        }

    merci d'avance pour vos réponses

  2. #2
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Quelle est la question? Comment passer un object Exemple à ta fenêtre? Il suffit de le créer, comme pour le reste.
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
     
                 Fenetre3 f3= new Fenetre3(new Exemple());
                 f3.setVisible(false);
                 SplashJDialog splash = new SplashJDialog(f3);

  3. #3
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Décembre 2016
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Décembre 2016
    Messages : 19
    Points : 20
    Points
    20
    Par défaut
    Salut ;

    en fait j'ai la fenetre Fenetre3 contenant un boutton qui permet l'ouverture d'une autre fenetre(Exemple)les deux sont liées la classe Exemple contient un bouton qui utilisera des composants de la classe Fenetre3...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    public class Exemple extends JPanel  {
     JList liste = new JList();
     String nom;
     
     
    	public Exemple(Fenetre3 fen) {
              this.fen=fen;//pour que je puisse référencer au composant jtable de Fenetre3
     
      liste.setFont(new Font("Engravers MT", Font.PLAIN, 11));
    donc dans la meme classe Fenetre3 j'ai un autre boutton qui ouvre une autre Fenetre Solution et cette dernière fait aussi la référence au composants de classe Fenetre3 et aussi elle a besoin des attributs de la classe Exemple
    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
    public class Solution1 extends JDialog {//extrait de la classe Exemple
     private javax.swing.JList<File> jList2;
     private javax.swing.JList<String> jList3;
     Fenetre3 fen;
     Exemple ex;
             String path;
    String nom;
    String nammelist2;
    ArrayList<String> listmanamessg=new ArrayList<String>();
        /**
         * Creates new form Solution
         */
        public Solution1(Fenetre3 fen,Exemple ex) {
            initComponents();
            this.fen=fen;
            this.ex=ex;
            this.setSize(1366, 740);
     DefaultListModel model = new DefaultListModel<>();
                  ArrayList<String>lispath=   fen.getLisnom();
                  ArrayList<String> lisnompath=ex.getLisnp();//listepath de Fenetre exemple
                  System.out.println(lispath);
                  System.out.println(lisnompath);
                   if(lispath!=null){
     
                  for(int i=0;i<lispath.size();i++){
                     File file = new File(lispath.get(i));
     
            		model.addElement(file);
     
                           }
     
     
     
             jList2.setModel(model);
             DefaultListModel modl=new DefaultListModel();
             modl.addElement("");
             modl.addElement("");
             jList3.setModel(modl);}else if(lisnompath!=null){for(int i=0;i<lispath.size();i++){
                     File file = new File(lispath.get(i));
     
            		model.addElement(file);
     
                           }
     
     
     
             jList2.setModel(model);
             DefaultListModel modl=new DefaultListModel();
             modl.addElement("");
             modl.addElement("");jList3.setModel(modl);}
     
     
        }
    pour la classe princiaple Fenetre3 le code de boutton Solution1
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
         // Exemple ex1=getEx();
        Solution1 sol=  new Solution1(this,/*   */);
     
     
     
        }
    je suis débutante donc je vois les choses très compliqués merci d'avance pour vos réponses

  4. #4
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    tu as déjà ta réponse en commentaire. Exemple ex1=getEx();

    Bien sûr, il faut que cet Exemple soit stocké comme champ dans ta Fenetre3, et l'endroit le plus simple pour le faire c'est dans le constructeur de Fenetre3
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    Fenetre3 f3= new Fenetre3();
                 f3.setVisible(false);
                 SplashJDialog splash = new SplashJDialog(f3);
    Ta classe Fenetre3:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
     
    public Fenetre3(){
     
       this.ex = new Exemple(this);
    }
     
    private Exemple getEx(){
        return this.ex
    }
    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {      
        Solution1 sol=  new Solution1(this,getEx());
        }

  5. #5
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Décembre 2016
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Décembre 2016
    Messages : 19
    Points : 20
    Points
    20
    Par défaut
    Salut encore;

    J'ai fait ce que vous avez postulé;mais elle me donnera une liste vide pour la classe Solution1 quand j'ai fait l'affichage d'une liste ;

    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
    public class Solution1 extends JDialog {
     private javax.swing.JList<File> jList2;
     private javax.swing.JList<String> jList3;
     Fenetre3 fen;
     Exemple ex;
             String path;
    String nom;
    String nammelist2;
    ArrayList<String> listmanamessg=new ArrayList<String>();
        /**
         * Creates new form Solution
         */
        public Solution1(Fenetre3 fen,Exemple ex) {
            initComponents();
            this.fen=fen;
     
           this.ex=ex;
            this.setSize(1366, 740);
     
    		setPreferredSize(new Dimension(640, 640));
    		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
     
            setVisible(true);
     
     
     
    		 DefaultListModel model = new DefaultListModel<>();
                  ArrayList<String>lispath=   fen.getLisnom();
                  ArrayList<String> lisnompath=ex.getLisnp();//listepath de Fenetre exemple
                  System.out.println(lispath);///après l'éxécution de l'application cette liste est vide
                  System.out.println(lisnompath);
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {                                         
     
     
       Solution1 sol=  new Solution1(this,getEx());
     
     
     
        }
     
        public Exemple getEx() {
            return this.ex;
        }

    Merci d'avance pour vos réponses

  6. #6
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Ben c'est que la liste dans ton exemple est vide, simplement.

  7. #7
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Décembre 2016
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Décembre 2016
    Messages : 19
    Points : 20
    Points
    20
    Par défaut
    Bonsoir;

    j'ai fait l'affichage de la liste dans la classe ou elle se trouve déjà c'est pas vide
    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
     
    public class Exemple extends JPanel  {
     JList liste = new JList();
     String nom;
    private static Exemple exemple;
    private static JFrame exempleFrame;
    Fenetre3 fen;
    int sommesuc=0,sommeechec=0,sommefailed=0;
     
     ArrayList<String> lisnom=new ArrayList<String>();
         ArrayList<String> lisnp=new ArrayList<String>();
     
     
    	public Exemple(Fenetre3 fen) {
            this.fen=fen;}
      public void save1(ArrayList<String> liste,String pathtoExplore) throws IOException, JDOMException, FileNotFoundException, EncryptedDocumentException, InvalidFormatException{
     
     
          ArrayList<String> result1= fen.getListname();
         ArrayList<String> result=fen.getListepath();
          ListModel<File> model2=fen.getModell();
         for(int i=0;i<model2.getSize();i++){
     
     
             Lister_path diskFileExplorer = new Lister_path(model2.getElementAt(i).toString(),true);
        ArrayList<String> list= diskFileExplorer.Lister_path();
     
            for(int j=0;j<list.size();j++){
            result.add(list.get(j));}}
                    int l=0,row=0,i=0,h=0;
             DefaultTableModel   tableModel=    fen.getmodel();
     
     
            while(i< result.size()&& l<result1.size()&& h<model2.getSize()){
            String nompath=result.get(i);
            System.out.println(result1.get(l));
            Reader_xml read=new Reader_xml();
        ArrayList<String> listabreg=  read.getName(nompath);
        ArrayList<String> listfunction=  read.getfunction(nompath);
     
            ReadExeLS reedexel=new ReadExeLS();
                 ArrayList<String> lisn=reedexel.ReadEx(liste);
                 ArrayList<String> lisfun=reedexel.getListefunction();
     
                 int j=0,k=0, S=0;
     
                while(k<lisn.size()&&j<listabreg.size()&&k<lisfun.size()&&j<listfunction.size()){
     
                    if((lisn.get(k)).equalsIgnoreCase(listabreg.get(j))&&(lisfun.get(k).equalsIgnoreCase(listfunction.get(j)))){
                     S++;k++;j=0;
                        System.out.println(S);
     
                    }else{System.out.println(S);j++;if(j==listabreg.size()){j=0;k++;}else{System.out.println(S);}}}
     
     
            if(S==0){
     
     
     
     
                 tableModel.addRow(new String[]  {"","",""});
                tableModel.setValueAt(result1.get(l), row, 0);
     
                   l++;row++;i++;h++;
                   sommeechec++;
     
     
     
     
            }else if(S==lisn.size()){
     
     
             tableModel.addRow(new String[]  {"","",""});
           tableModel.setValueAt(result1.get(l), row, 1);
     
     
     
        sommesuc++;
            l++;row++; i++;h++;}
            else{
     
             tableModel.addRow(new String[]  {"","",""});
     
           tableModel.setValueAt(result1.get(l), row, 2);
     
         lisnom.add(model2.getElementAt(h).toString());//nom repertoire
         lisnp.add(result.get(i));//nom path
     
        sommefailed++;
            l++;row++;i++;h++;}
     
     
            System.out.println(lisnp);//la liste que je veux l'afficher elle n'est pas vide dans sa classe
     
     
            }new StatistiqueDialog();}public ArrayList<String> getLisnp() {
            return lisnp;
        }}
    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
    public class Solution1 extends JDialog {
     private javax.swing.JList<File> jList2;
     private javax.swing.JList<String> jList3;
     Fenetre3 fen;
     Exemple ex;
             String path;
    String nom;
    String nammelist2;
    ArrayList<String> listmanamessg=new ArrayList<String>();
        /**
         * Creates new form Solution
         */
        public Solution1(Fenetre3 fen,Exemple ex) {
            initComponents();
            this.fen=fen;
          /// Exemple ex= fen.getEx();
           this.ex=ex;
            this.setSize(1366, 740);
            // this.setExtendedState(MAXIMIZED_BOTH);
    		setPreferredSize(new Dimension(640, 640));
    		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
    		//setBounds(100, 100, 1366, 740);
            setVisible(true);
     
     
           // jList2.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
     
    		 DefaultListModel model = new DefaultListModel<>();
                  ArrayList<String>lispath=   fen.getLisnom();
                  ArrayList<String> lisnompath=ex.getLisnp();//listepath de Fenetre exemple --dans cette classe elle est vide

  8. #8
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    Tu pourrais poster le code avec

    1) une indentation correcte (c'est illisible là)
    2) en montrant bien ou chaque chose est initialisée. Je ne vous pas où ta liste est remplie et où tes constructeurs sont appelé.

    Est-ce que tu es sur d'appeler ton constructeur APRES avoir remplis la liste?

  9. #9
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Décembre 2016
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Décembre 2016
    Messages : 19
    Points : 20
    Points
    20
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    Tu pourrais poster le code avec

    1) une indentation correcte (c'est illisible là)
    2) en montrant bien ou chaque chose est initialisée. Je ne vous pas où ta liste est remplie et où tes constructeurs sont appelé.

    Est-ce que tu es sur d'appeler ton constructeur APRES avoir remplis la liste?
    Salut encore,Désolé pour le retard de postulation j'ai pas eu de connexion ,merci..

    Voici le code de la classe Principale Fenetre3
    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
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
    448
    449
    450
    451
    452
    453
    454
    455
    456
    457
    458
    459
    460
    461
    462
    463
    464
    465
    466
    467
    468
    469
    470
    471
    472
    473
    474
    475
    476
    477
    478
    479
    480
    481
    482
    483
    484
    485
    486
    487
    488
    489
    490
    491
    492
    493
    494
    495
    496
    497
    498
    499
    500
    501
    502
    503
    504
    505
    506
    507
    508
    509
    510
    511
    512
    513
    514
    515
    516
    517
    518
    519
    520
    521
    522
    523
    524
    525
    526
    527
    528
    529
    530
    531
    532
    533
    534
    535
    536
    537
    538
    539
    540
    541
    542
    543
    544
    545
    546
    547
    548
    549
    550
    551
    552
    553
    554
    555
    556
    557
    558
    559
    560
    561
    562
    563
    564
    565
    566
    567
    568
    569
    570
    571
    572
    573
    574
    575
    576
    577
    578
    579
    580
    581
    582
    583
    584
    585
    586
    587
    588
    589
    590
    591
    592
    593
    594
    595
    596
    597
    598
    599
    600
    601
    602
    603
    604
    605
    606
    607
    608
    609
    610
    611
    612
    613
    614
    615
    616
    617
    618
    619
    620
    621
    622
    623
    624
    625
    626
    627
    628
    629
    630
    631
    632
    633
    634
    635
    636
    637
    638
    639
    640
    641
    642
    643
    644
    645
    646
    647
    648
    649
    650
    651
    652
    653
    654
    655
    656
    657
    658
    659
    660
    661
    662
    663
    664
    665
    666
    667
    668
    669
    670
    671
    672
    673
    674
    675
    676
    677
    678
    679
    680
    681
    682
    683
    684
    685
    686
    687
    688
    689
    690
    691
    692
    693
    694
    695
    696
    697
    698
    699
    700
    701
    702
    703
    704
    705
    706
    707
    708
    709
    710
    711
    712
    713
    714
    715
    716
    717
    718
    719
    720
    721
    722
    723
    724
    725
    726
    727
    728
    729
    730
    731
    732
    733
    734
    735
    736
    737
    738
    739
    740
    741
    742
    743
    744
    745
    746
    747
    748
    749
    750
    751
    752
    753
    754
    755
    756
    757
    758
    759
    760
    761
    762
    763
    764
    765
    766
    767
    768
    769
    770
    771
    772
    773
    774
    775
    776
    777
    778
    779
    780
    781
    782
    783
    784
    785
    786
    787
    788
    789
    790
    791
    792
    793
    794
    795
    796
    797
    798
    799
    800
    801
    802
    803
    804
    805
    806
    807
    808
    809
    810
    811
    812
    813
    814
    815
    816
    817
    818
    819
    820
    821
    822
    823
    824
    825
    826
    827
    828
    829
    830
    831
    832
    833
    834
    835
    836
    837
    838
    839
    840
    841
    842
    843
    844
    845
    846
    847
    848
    849
    850
    851
    852
    853
    854
    855
    856
    857
    858
    859
    860
    861
    862
    863
    864
    865
    866
    867
    868
    869
    870
    871
    872
    873
    874
    875
    876
    877
    878
    879
    880
    881
    882
    883
    884
    885
    886
    887
    888
    889
    890
    891
    892
    893
    894
    895
    896
    897
    898
    899
    900
    901
    902
    903
    904
    905
    906
    907
    908
    909
    910
    911
    912
    913
    914
    915
    916
    917
    918
    919
    920
    921
    922
    923
    924
    925
    926
    927
    928
    929
    930
    931
    932
    933
    934
    935
    936
    937
    938
    939
    940
    941
    942
    943
    944
    945
    946
    947
    948
    949
    950
    951
    952
    953
    954
    955
    956
    957
    958
    959
    960
    961
    962
    963
    964
    965
    966
    967
    968
    969
    970
    971
    972
    973
    974
    975
    976
    977
    978
    979
    980
    981
    982
    983
    984
    985
    986
    987
    988
    989
    990
    991
    992
    993
    994
    995
    996
    997
    998
    999
    1000
    1001
    1002
    1003
    1004
    1005
    1006
    1007
    1008
    1009
    1010
    1011
    1012
    1013
    1014
    1015
    1016
    1017
    1018
    1019
    1020
    1021
    1022
    1023
    1024
    1025
    1026
    1027
    1028
    1029
    1030
    1031
    1032
    1033
    1034
    1035
    1036
    1037
    1038
    1039
    1040
    1041
    1042
    1043
    1044
    1045
    1046
    1047
    1048
    1049
    1050
    1051
    1052
    1053
    1054
    1055
    1056
    1057
    1058
    1059
    1060
    1061
    1062
    1063
    1064
    1065
    1066
    1067
    1068
    1069
    1070
    1071
    1072
    1073
    1074
    1075
    1076
    1077
    1078
    1079
    1080
    1081
    1082
    1083
    1084
    1085
    1086
    1087
    1088
    1089
    1090
    1091
    1092
    1093
    1094
    1095
    1096
    1097
    1098
    1099
    1100
    1101
    1102
    1103
    1104
    1105
    1106
    1107
    1108
    1109
    1110
    1111
    1112
    1113
    1114
    1115
    1116
    1117
    1118
    1119
    1120
    1121
    1122
    1123
    1124
    1125
    1126
    1127
    1128
    1129
    1130
    1131
    1132
    1133
    1134
    1135
    1136
    1137
    1138
    1139
    1140
    1141
    1142
    1143
    1144
    1145
    1146
     
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
     
    /**
     *
     * @author W.S.I
     */
     
    import java.awt.Dimension;
    import static java.awt.Frame.MAXIMIZED_BOTH;
    import java.awt.Graphics;
    import java.awt.Insets;
    import java.awt.Toolkit;
    import java.awt.event.KeyEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
     
    import java.util.Arrays;
    import javax.swing.DefaultListCellRenderer;
    import java.io.FileNotFoundException;
    import java.io.FileOutputStream;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.io.StringReader;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import java.util.zip.GZIPInputStream;
    import static javax.management.Query.value;
    import static javax.management.Query.value;
    import static javax.management.Query.value;
    import javax.swing.DefaultListModel;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JButton;
    import javax.swing.JFileChooser;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.JOptionPane;
    import javax.swing.JProgressBar;
    import javax.swing.JTable;
    import javax.swing.ListModel;
    import javax.swing.SwingWorker;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.filechooser.FileNameExtensionFilter;
    import javax.swing.table.DefaultTableModel;
    import javax.swing.text.BadLocationException;
    import org.apache.poi.EncryptedDocumentException;
    import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
    import org.jdom2.JDOMException;
     
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
    /**
     *
     * @author W.S.I
     */
    public class Fenetre3 extends javax.swing.JFrame {
     JFileChooser chooser = new JFileChooser();
    ArrayList<String> resultt ;
    String lastPathList;
    String pathload;
     ArrayList<String> lisfun=new ArrayList<>();
    int sommesuc=0,sommeechec=0,sommefailed=0;
    JFrame frame1 = new JFrame();
     ArrayList<String> lis=new ArrayList<String>();
    ArrayList<String> listrep=new ArrayList<String>();
     javax.swing.JTable jTable1;
     javax.swing.JTextArea jTextArea2;
    ArrayList<String>listnam=new ArrayList<String>();
    File fil;
     JProgressBar progressBar = new JProgressBar();
     ArrayList<String> lisnom=new ArrayList<String>();
         ArrayList<String> lisnp=new ArrayList<String>();
       ArrayList<String>lisnomedit=new ArrayList<String>();
        Icon icone=new ImageIcon("recherch.png"); 
     DefaultTableModel  model = new DefaultTableModel();
     ArrayList<String> lisnomexcel=new ArrayList<String>();
    String pathret;
    ArrayList<String> listepath=new ArrayList<String>();
    ArrayList<String>listname=new ArrayList<String>();
    ListModel<File> modell;
    ArrayList<String>listnomtextarea=new ArrayList<String>();
        /**
         * Creates new form Fenetre
         */
        String choosertitle;
     
     Exemple ex;
     
        /**
         * Creates new form Fenetre
         */
     
     
        public Fenetre3() {
         this.ex=new Exemple(this);
            initComponents();
     
     
            setIcon();
            //pour la dimension de la fenetre soit la meme pour l'ecran
            setExtendedState(MAXIMIZED_BOTH);
    		setPreferredSize(new Dimension(640, 640));
    		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		setBounds(100, 100, 640, 470);
     
     
        }
     
        //classe import
     
        /**
         * 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.
         */
        @SuppressWarnings("unchecked")
     
     
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
    jButton5 = new javax.swing.JButton();
            jPanel1 = new javax.swing.JPanel();
            jPanel2 = new javax.swing.JPanel();
            jPanel3 = new javax.swing.JPanel();
            jPanel10 = new javax.swing.JPanel();
            jScrollPane4 = new javax.swing.JScrollPane();
            jTextArea2 = new javax.swing.JTextArea();
            jPanel9 = new javax.swing.JPanel();
            jScrollPane3 = new javax.swing.JScrollPane();
            jTextArea1 = new javax.swing.JTextArea();
            jPanel8 = new javax.swing.JPanel();
            jLabel1 = new javax.swing.JLabel();
            jPanel7 = new javax.swing.JPanel();
            jScrollPane2 = new javax.swing.JScrollPane();
            jTable1 = new javax.swing.JTable();
            jPanel6 = new javax.swing.JPanel();
            jScrollPane1 = new javax.swing.JScrollPane();
            jList1 = new javax.swing.JList<>();
            jPanel5 = new javax.swing.JPanel();
            recherch = new javax.swing.JTextField();
            jPanel4 = new javax.swing.JPanel();
            path = new javax.swing.JTextField();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jButton3 = new javax.swing.JButton();
            jButton4 = new javax.swing.JButton();
            jPanel11 = new javax.swing.JPanel();
            jLabel2 = new javax.swing.JLabel();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
            setTitle("Analyseur de traces 3G");
            getContentPane().setLayout(null);
     
            jPanel1.setBackground(new java.awt.Color(153, 153, 153));
            jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel1.setLayout(null);
     
            jPanel2.setBackground(new java.awt.Color(153, 153, 153));
            jPanel2.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel2.setLayout(new java.awt.BorderLayout());
     
            jPanel3.setBackground(new java.awt.Color(153, 153, 153));
            jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel3.setLayout(null);
     
            jPanel10.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel10.setLayout(new java.awt.BorderLayout());
     
            jTextArea2.setColumns(20);
             jTextArea2.setFont(new java.awt.Font("Consolas", 0, 13));
            jTextArea2.setRows(5);
            jScrollPane4.setViewportView(jTextArea2);
     
            jPanel10.add(jScrollPane4, java.awt.BorderLayout.CENTER);
     
            jPanel3.add(jPanel10);
     
            jPanel10.setBounds(260, 430, 700, 210);
     
            jPanel9.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel9.setLayout(new java.awt.BorderLayout());
     
            jTextArea1.setColumns(20);
            jTextArea1.setFont(new java.awt.Font("Consolas", 0, 13));
            jTextArea1.setRows(5);
            jScrollPane3.setViewportView(jTextArea1);
     
            jPanel9.add(jScrollPane3, java.awt.BorderLayout.CENTER);
     
            jPanel3.add(jPanel9);
     
            jPanel9.setBounds(260, 60, 700, 360);
     
            jPanel8.setBackground(new java.awt.Color(153, 153, 153));
            jPanel8.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel8.setLayout(new java.awt.BorderLayout());
     
            jLabel1.setBackground(new java.awt.Color(153, 153, 153));
            jLabel1.setText("        ");
            jPanel8.add(jLabel1, java.awt.BorderLayout.CENTER);
     
    		progressBar.setVisible(false);
    		jPanel8.add(progressBar);
     
            jPanel3.add(jPanel8);
            jPanel8.setBounds(10, 650, 250, 25);
     
            jPanel7.setBackground(new java.awt.Color(250, 250, 250));
            jPanel7.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel7.setLayout(new java.awt.BorderLayout());
     
            jTable1.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
     
                },
                new String [] {
                    "Not case", "Succeed", "Failed"
                }
            ) {
                Class[] types = new Class [] {
                    java.lang.String.class, java.lang.String.class, java.lang.String.class
                };
     
                public Class getColumnClass(int columnIndex) {
                    return types [columnIndex];
                }
            });
            jScrollPane2.setViewportView(jTable1);
     
            jPanel7.add(jScrollPane2, java.awt.BorderLayout.CENTER);
     
            jPanel3.add(jPanel7);
     
             jPanel7.setBounds(970, 60, 370, 580);
     
            jPanel6.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel6.setLayout(new java.awt.BorderLayout());
     
             jList1.setCellRenderer(new DefaultListCellRenderer() {
                public java.awt.Component getListCellRendererComponent(JList<?> jlist, Object value, int index, boolean selected, boolean focused) {
                    if ( value instanceof File ) {
                        value = ((File)value).getName(); // on ne veut afficher que le nom du dossier
                    }
                    return super.getListCellRendererComponent(jlist, value, index, selected, focused);
                };
            });
            jList1.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
                public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                    jList1ValueChanged(evt);
                }
     
                private void jList1ValueChanged(ListSelectionEvent evt) {
     
     
           if ( evt.getValueIsAdjusting() ) {
     
               ListListener lis=new ListListener();
               lis.execute();
     
    				}
                }
            });
    jList1.setCellRenderer(new DefaultListCellRenderer() {
                public java.awt.Component getListCellRendererComponent(JList<?> jlist, Object value, int index, boolean selected, boolean focused) {
                    if ( value instanceof File ) {
                        value = ((File)value).getName(); // on ne veut afficher que le nom du dossier
                    }
                    return super.getListCellRendererComponent(jlist, value, index, selected, focused);
                };
            });
            jScrollPane1.setViewportView(jList1);
     
            jPanel6.add(jScrollPane1, java.awt.BorderLayout.CENTER);
     
            jPanel3.add(jPanel6);
     
             jPanel6.setBounds(10, 110, 240, 530);
     
            jPanel5.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel5.setLayout(new java.awt.BorderLayout());
     
            recherch.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    recherchActionPerformed(evt);
                }
            });
            recherch.addKeyListener(new java.awt.event.KeyAdapter() {
     
                public void keyReleased(java.awt.event.KeyEvent evt) {
                    recherchKeyReleased(evt);
                }
               private void recherchKeyReleased(java.awt.event.KeyEvent evt) {                                     
            // TODO add your handling code here:
            lancerRecherche1(recherch.getText());
         //  Recherch rch=new Recherch();
          // rch.execute();
     
        } 
     
     
            });
            jPanel5.add(recherch, java.awt.BorderLayout.CENTER);
     
            jPanel3.add(jPanel5);
            jPanel5.setBounds(10, 60, 210, 40);
     
    //jPanel5.setBounds(10, 60, 260, 40);
            jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel4.setLayout(new java.awt.BorderLayout());
     
            path.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jTextField1ActionPerformed(evt);
                }
            });
            jPanel4.add(path, java.awt.BorderLayout.CENTER);
     
            jPanel3.add(jPanel4);
            jPanel4.setBounds(10, 10, 1190, 40);
     
            jButton1.setText("Import");
     
            jPanel3.add(jButton1);
            jButton1.setBounds(1210, 10, 130, 40);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    try {
                        jButton1ActionPerformed(evt);
                    } catch (IOException ex) {
                        Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            });
            jButton2.setText("Analyze");
            jPanel3.add(jButton2);
             jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    try {
                        try {
                            jButton2ActionPerformed(evt);
                        } catch (FileNotFoundException ex) {
                            Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                        } catch (BadLocationException ex) {
                            Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                        }
                    } catch (IOException ex) {
                        Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (EncryptedDocumentException ex) {
                        Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (InvalidFormatException ex) {
                        Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            });
            jButton2.setBounds(1240, 650, 100, 30);
     
            jButton3.setText("Load");
             jButton3.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    try {
                        jButton3ActionPerformed(evt);
                    } catch (IOException ex) {
                        Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (InvalidFormatException ex) {
                        Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (JDOMException ex) {
                        Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            });
            jPanel3.add(jButton3);
            jButton3.setBounds(1120, 650, 110, 30);
     
            jButton4.setText("Display editor");
            jButton4.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton4ActionPerformed(evt);
                }
            });
            jPanel3.add(jButton4);
           // 970, 60, 370, 580);
            jButton4.setBounds(970, 650, 138, 30);
             jPanel11.setBackground(new java.awt.Color(255, 255, 255));
            jPanel11.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel11.setLayout(null);
     
            jLabel2.setIcon(new javax.swing.ImageIcon("C:\\Users\\W.S.I\\Documents\\NetBeansProjects\\PFE_test\\src\\1623.png")); // NOI18N
            jPanel11.add(jLabel2);
            jLabel2.setBounds(0, 0, 30, 40);
     
            jPanel3.add(jPanel11);
            jPanel11.setBounds(220, 60, 30, 40);
            jButton5.setText("Solutions");
            jButton5.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton5ActionPerformed(evt);
                }
            });
            jPanel3.add(jButton5);
            jButton5.setBounds(820, 650, 140, 30);
            jPanel2.add(jPanel3, java.awt.BorderLayout.CENTER);
     
            jPanel1.add(jPanel2);
            jPanel2.setBounds(5, 5, 1390, 730);
     
            getContentPane().add(jPanel1);
            jPanel1.setBounds(0, 0, 1400, 740);
     
            pack();
            setLocationRelativeTo(null);
        }// </editor-fold>                        
     
        private void jTextField1ActionPerformed(java.awt.event.ActionEvent evt) {                                            
            // TODO add your handling code here:
        }                                           
     
        private void recherchActionPerformed(java.awt.event.ActionEvent evt) {                                         
            // TODO add your handling code here:
        }                                        
     
         public void jButton1ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {    
          //  public ArrayList<String> jButton1ActionPerformed(java.awt.event.ActionEvent evt) throws IOException {
            // TODO add your handling code here:
            chooser.setCurrentDirectory(new java.io.File("."));
            chooser.setDialogTitle(choosertitle);
            chooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
     
            chooser.setAcceptAllFileFilterUsed(false);
            //    
            if (chooser.showOpenDialog(this) == JFileChooser.APPROVE_OPTION) {
                System.out.println("getCurrentDirectory(): "
                        + chooser.getCurrentDirectory());
                System.out.println("getSelectedFile() : "
                        + chooser.getSelectedFile());
              Import imp=  new Import();
              imp.execute();
     
            } else {
                System.out.println("No Selection ");
            }
     
     
     
        }                                        
     
         private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) throws IOException, FileNotFoundException, EncryptedDocumentException, InvalidFormatException, BadLocationException {
     
       DefaultTableModel model1=getmodel();
       getmodel().getDataVector().removeAllElements();
     
     
     
    Worker work=new Worker();
          work.execute();
     
     
     
     
     
         }
     
        private void jButton4ActionPerformed(java.awt.event.ActionEvent evt) { 
         //   if()
            DefaultTableModel model1=getmodel();
       getmodel().getDataVector().removeAllElements();
         if(getPathret()==null){JOptionPane.showMessageDialog(Fenetre3.this, "Veillez importer la liste d'appels pour pouvoir faire l'analyse !","Info",
                        JOptionPane.INFORMATION_MESSAGE);}
         else{
     
     
     
     
               frame1.getContentPane().removeAll();
               frame1.getContentPane().add(new Exemple(this));
     
     
    		frame1.pack();
    		frame1.setLocationRelativeTo(null);
                     frame1.setTitle("Editeur graphique");
    		frame1.setVisible(true);
     
        } }
     
        private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) throws IOException, FileNotFoundException, InvalidFormatException, JDOMException {                                         
            // TODO add your handling code here:
     
             JFileChooser fileChooser = new JFileChooser();
             ArrayList<String> lisnom2=new ArrayList<>();
             lisnom2.clear();
             lisnomedit.clear();
    				if(fileChooser.showOpenDialog(null) == JFileChooser.APPROVE_OPTION){
     
                                            FileNameExtensionFilter filter = new FileNameExtensionFilter("Fichier de trace ","txt");
    			fileChooser.addChoosableFileFilter(filter);
                         File   fichier = fileChooser.getSelectedFile();
                       pathload= fileChooser.getSelectedFile().toString();
     
                              FileReader file = null;       
                         try{
                             InputStream flux=new FileInputStream(fileChooser.getSelectedFile().toString());
                             InputStreamReader lecture=new InputStreamReader(flux);
                             BufferedReader buff=new BufferedReader(lecture);
                             String ligne;
     
                             while ((ligne=buff.readLine())!=null ){
     
                               lisnom2.add(ligne);
     
                             }
                             buff.close();
                         }
                         catch (Exception e){
                             System.out.println(e.toString());
                         }
                         for(int i=0;i<lisnom2.size();i++)
                         {
                             String nom=lisnom2.get(i);
     
                             if(!nom.equals("")){lisnomedit.add(nom);}else{System.out.println("cc");}}
                         System.out.println(lisnomedit);
                            ReadExeLS reedexel=new ReadExeLS();
                  lisnomexcel=reedexel.ReadEx(lisnomedit);//nom abrege
                 lisfun=reedexel.getListefunction();
     
                       String path2=  System.getProperty("user.home").concat("\\").concat("sena.txt");
                       System.out.println(path2);
     
                       Saveeditor inst2=new Saveeditor();
                       inst2.save(lisnomedit, path2);
                        file = new FileReader(path2);
                        BufferedReader br=new BufferedReader(file);
                        try {
                            jTextArea2.read(br,null);
     
                        } catch (IOException e) {
     
                            e.printStackTrace();
                        }
     
     
     
     
                                    }
        } 
     
        /**
         * @param args the command line arguments
         */
        public static void main(String args[]) {
     
            /* Set the Nimbus look and feel */
            //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
            /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
             * For details see <a href="http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html" target="_blank">http://download.oracle.com/javase/tu...feel/plaf.html</a> 
             */
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(Fenetre3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(Fenetre3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(Fenetre3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(Fenetre3.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
     
            /* Create and display the form */
            java.awt.EventQueue.invokeLater(new Runnable() {
     
                public void run() {
     
     
                    new Fenetre3().setVisible(false);
     
                 SplashJDialog splash = new SplashJDialog(new Fenetre3());
     
     
                  (new Thread(splash)).start();
                }
            });
        }
     
        // Variables declaration - do not modify 
        private javax.swing.JButton jButton5;
        private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JButton jButton3;
        private javax.swing.JButton jButton4;
        private javax.swing.JLabel jLabel1;
        private javax.swing.JList<File> jList1;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel10;
        private javax.swing.JPanel jPanel2;
        private javax.swing.JPanel jPanel3;
        private javax.swing.JPanel jPanel4;
        private javax.swing.JPanel jPanel5;
        private javax.swing.JPanel jPanel6;
        private javax.swing.JPanel jPanel7;
        private javax.swing.JPanel jPanel8;
        private javax.swing.JPanel jPanel9;
         private javax.swing.JPanel jPanel11;
          private javax.swing.JLabel jLabel2;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JScrollPane jScrollPane2;
        private javax.swing.JScrollPane jScrollPane3;
        private javax.swing.JScrollPane jScrollPane4;
     
        private javax.swing.JTextArea jTextArea1;
     
        private javax.swing.JTextField path;
        private javax.swing.JTextField recherch;
        // End of variables declaration                   
     
        private void setIcon() {
            //To change body of generated methods, choose Tools | Templates.
            setIconImage(Toolkit.getDefaultToolkit().getImage(getClass().getResource("nokia_icon.png")));
        }
     
       private static void decompressGzipFile(String gzipFile, String newFile) {
            try {
                FileInputStream fis = new FileInputStream(gzipFile);
                GZIPInputStream gis = new GZIPInputStream(fis);
                FileOutputStream fos = new FileOutputStream(newFile);
                byte[] buffer = new byte[1024];
                int len;
                while((len = gis.read(buffer)) != -1){
                    fos.write(buffer, 0, len);
                }
                //close resources
                fos.close();
                gis.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
     
        }
     
        public String getPathret() {
            return pathret;
        }
     
        public ArrayList<String> getListnam() {
            return listnam;
        }
     
        public ArrayList<String> getListrep() {
            return listrep;
        }
     
     
       private void lancerRecherche1(String text) {
             //To change body of generated methods, choose Tools | Templates.
                String chaine=recherch.getText();
                System.out.println(chaine);
     
            DefaultListModel model3 = new DefaultListModel<>();
            int i=0;
            if(chaine!=null&&!chaine.equals("")){
                ListModel<File> modell=jList1.getModel();
            while(i<modell.getSize()){
     
                         File fil=   modell.getElementAt(i);
                         String text1=fil.getName();
                            if(chaine.contains(text1)){
                                System.out.println(text1);
     
                           DefaultListModel model2 = new DefaultListModel<>();
     
            		model2.addElement(fil);
     
                            jList1.setModel(model2);
                            i=modell.getSize();}else{i++;}}}else {
                  System.out.println("cccc");
                            String pathlist = chooser.getSelectedFile().toString();
                            System.out.println(pathlist);
                        File fil2 = new File(pathlist);
            File[] listefile1 = fil2.listFiles();
               if( listefile1!=null) {
            	for(File file : listefile1) {
            		model3.addElement(file);
                           }}
     
                jList1.setModel(model3);}}
     
     
     
        public JFrame getFrame1() {
            return frame1;
        }
     
         public ListModel<File> getModell() {
            return modell;
        }
     
        public ArrayList<String> getListepath() {
            return listepath;
        }
     
        public ArrayList<String> getListname() {
            return listname;
        }
             public DefaultTableModel getmodel()
    { 
     
     
        DefaultTableModel model=(DefaultTableModel) jTable1.getModel();
     
     
     
     
        return model;
    }
     
            public class Import extends SwingWorker<Void,Void>{
     
               protected Void doInBackground() throws Exception{
                   progressBar.setIndeterminate(true);
    				progressBar.setVisible(true);
                  path.setText(chooser.getSelectedFile().toString());
                        String pathlist = chooser.getSelectedFile().toString();
                        File fil = new File(pathlist);
            File[] listefile = fil.listFiles();
            pathret=chooser.getSelectedFile().toString();
            path.setText(chooser.getSelectedFile().toString());
               DefaultListModel model = new DefaultListModel<>();
               if( listefile!=null) {
            	for(File file : listefile) {
            		model.addElement(file);
     
                            listname.add(file.getName());
     
            	}
               }
               jList1.setModel(model); 
            modell=jList1.getModel();
               return null;
               }
               public void done(){
     
    			progressBar.setVisible(false);
     
     
    		}
            }
            public class ListListener extends SwingWorker<Void,Void>{
            protected Void doInBackground()throws Exception{
            progressBar.setIndeterminate(true);
    				progressBar.setVisible(true);
             Main senre=new Main();
                 Long start = System.currentTimeMillis();
    					File selectedFile = jList1.getSelectedValue(); // je récupère le File sélectionné dans la JList
    					File[] files = selectedFile.listFiles();
     
                                            String select=selectedFile.toString();// je cherche les fichiers (et que les fichiers) qui s'y trouvent
                                         char c='\\';
     
                         String d=Character.toString(c);
     
                         String pathfilesena=selectedFile.toString().concat(d).concat("CallflowSenario.txt");
     
     
    					if ( files!=null  ) {
                                int i = 0;
     
                                while( i <files.length) {
     
     
     
                       if(files[i].getName().startsWith("RNCCN")== true){
                           String pathfich=files[i].getAbsolutePath();
                          if(files[i].getName().endsWith(".xml.gz")){
                              String newFile= pathfich.replace(".gz", "");
                              i=files.length;decompressGzipFile(pathfich, newFile);
                              try {
                             senre.mainMethod(newFile,pathfilesena);
                                    } catch (Exception ex) {
                                  Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                                                        }
                         FileReader file = null;
                         try{
                             file = new FileReader(pathfilesena);
     
                         } catch (FileNotFoundException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                         }
                         BufferedReader br=new BufferedReader(file);
                         try {
                             jTextArea1.read(br,null);
     
                             System.out.println("Analyse de senario  en " + (System.currentTimeMillis() - start) + " mses");
                         } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                         }
                         try {
                             br.close();
                         } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                         }}else if((files[i].getName().endsWith(".xml"))){
                             String pathfich1=files[i].getAbsolutePath();
                             i=files.length; try {
                             senre.mainMethod(pathfich1,pathfilesena);
                                    } catch (Exception ex) {
                                  Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                                                        }
                         FileReader file = null;
                         try{
                             file = new FileReader(pathfilesena);
     
                         } catch (FileNotFoundException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                         }
                         BufferedReader br=new BufferedReader(file);
                         try {
                             jTextArea1.read(br,null);
     
                             System.out.println("Analyse de senario  en " + (System.currentTimeMillis() - start) + " mses");
                         } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                         }
                         try {
                             br.close();
                         } catch (IOException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
                         }}else{
                             i++;}}
                           else{i++;}
     
    					}}
    					else {
    						System.out.println("Aucun fichier.");
    					}
     
            return null;
            }
            public void done(){progressBar.setVisible(false);}
     
     
            }
     
     
        public String getPathload() {
            return pathload;
        }
     
        public class Worker extends SwingWorker<Void, Void>{
     
            //@Override
            protected Void doInBackground() throws Exception {
                if(getPathret()==null){JOptionPane.showMessageDialog(Fenetre3.this, "Veillez importer la liste d'appels pour pouvoir faire l'analyse !","Info",
                        JOptionPane.INFORMATION_MESSAGE);}
                else{
                String path1=getPathload();
    System.out.println(path1);
    String chaine="";
     ArrayList lisnom=getLisnomedit();
     
     
                      progressBar.setIndeterminate(true);
    				progressBar.setVisible(true);
    	         save1(lisnom, getPathret());
     
     
                }
            //To change body of generated methods, choose Tools | Templates.
                return null;
            }
     
           // @Override
            public void done(){
     
    			progressBar.setVisible(false);
     
    		}
     
     
    }    
       public void save1(ArrayList<String> liste,String pathtoExplore) throws IOException, JDOMException, FileNotFoundException, EncryptedDocumentException, InvalidFormatException{
       ArrayList<String>nom=new  ArrayList<String>();
     //System.out.println(liste);
          ArrayList<String> result1= getListname();
         ArrayList<String> result=getListepath();//listepath
          ListModel<File> model2=getModell();//listrepaertoire
         for(int i=0;i<model2.getSize();i++){
     
                sommesuc=0;sommefailed=0;sommeechec=0;
             Lister_path diskFileExplorer = new Lister_path(model2.getElementAt(i).toString(),true);
        ArrayList<String> list= diskFileExplorer.Lister_path();
     
            for(int j=0;j<list.size();j++){
            result.add(list.get(j));}}
                    int l=0,row=0,i=0,h=0;
             DefaultTableModel   tableModel=    getmodel();
     
     
            while(i< result.size()&& l<result1.size() && h<model2.getSize()){
            String nompath=result.get(i);
            System.out.println(result1.get(l));
            Reader_xml read=new Reader_xml();
        ArrayList<String> listabreg=  read.getName(nompath);
        ArrayList<String> listfunction=  read.getfunction(nompath);
        System.out.println(listabreg);
        System.out.println(liste);
            ReadExeLS reedexel=new ReadExeLS();
                 ArrayList<String> lisn=reedexel.ReadEx(liste);
                 ArrayList<String> lisfun1=reedexel.getListefunction();
                 System.out.println(lisn);
              //   System.out.println(lisfun);
                 int j=0,k=0, S=0;
     
                 while(k<lisn.size()&&j<listabreg.size()&&k<lisfun1.size()&&j<listfunction.size()){
           if(k==0){
                     if(!(lisn.get(k).equalsIgnoreCase(listabreg.get(j))&&lisfun1.get(k).equalsIgnoreCase(listfunction.get(j)))){
     
            j++;if(j==listabreg.size()){k=lisn.size();tableModel.addRow(new String[]  {"","",""});
                tableModel.setValueAt(result1.get(l), row, 0);
     
                  sommeechec++;System.out.println(sommeechec); l++;row++;i++;h++;
                   }else{System.out.println(S);}
     
     
                     }else{S++;k++;j=0; }}
                     else{
     
                     if((lisn.get(k)).equalsIgnoreCase(listabreg.get(j))&&(lisfun1.get(k).equalsIgnoreCase(listfunction.get(j)))){
                     S++;k++;j=0;
                        System.out.println(S);}else{System.out.println(S);j++;if(j==listabreg.size()){j=0;k++;}else{System.out.println(S);}}}
     
     
     
     
     
                 }
     
     
     
            if(S==lisn.size()){
     
     
             tableModel.addRow(new String[]  {"","",""});
           tableModel.setValueAt(result1.get(l), row, 1);
     
     
     
        sommesuc++;
            l++;row++; i++;h++;}
            else if(S>0&&S<lisn.size()){
     
             tableModel.addRow(new String[]  {"","",""});
     
           tableModel.setValueAt(result1.get(l), row, 2);
           lisnom.add(model2.getElementAt(h).toString());
       //  lisnom.add(result1.get(l));
        lisnp.add(result.get(i));
     
        sommefailed++;
            l++;row++;i++;h++;} else{System.out.println(S);} 
     
            System.out.println(lisnom);
            System.out.println(lisnp);
     
     
     System.out.println("lllllll");
     
    System.out.println(sommeechec);
     System.out.println(sommefailed);
     System.out.println(sommesuc);
            } new StatistiqueDialog();}
     
     
        public int getSommesuc() {
            return sommesuc;
        }
     
        public int getSommeechec() {
            return sommeechec;
        }
     
        public int getSommefailed() {
            return sommefailed;
        }
    public class StatistiqueDialog extends javax.swing.JDialog {
    private Task task;
        /**
         * Creates new form StatistiqueDialog
         */
        public StatistiqueDialog() {
            initComponents();
            task = new Task();
    		task.execute();
    		this.setVisible(true);
        }
     
        /**
         * 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.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
     
            jPanel1 = new javax.swing.JPanel();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTextArea1 = new javax.swing.JTextArea();
            jButton1 = new javax.swing.JButton();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Résultats d'analyse : Statistiques");
            setPreferredSize(new java.awt.Dimension(450, 360));
            getContentPane().setLayout(null);
     
            jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel1.setPreferredSize(new java.awt.Dimension(450, 360));
            jPanel1.setLayout(new java.awt.BorderLayout());
     
            jTextArea1.setColumns(20);
            jTextArea1.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
            jTextArea1.setRows(5);
            jTextArea1.setSelectionColor(new java.awt.Color(255, 255, 255));
            jScrollPane1.setViewportView(jTextArea1);
     
            jPanel1.add(jScrollPane1, java.awt.BorderLayout.CENTER);
     
            getContentPane().add(jPanel1);
            jPanel1.setBounds(0, 0, 430, 290);
     
            jButton1.setText("Fermer");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
                }
            });
            getContentPane().add(jButton1);
            jButton1.setBounds(10, 290, 90, 30);
     
            pack();
        }// </editor-fold>                        
     
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            task.cancel(true);
    		StatistiqueDialog.this.dispose();
        }                                        
        /**
         * @param args the command line arguments
         */
     
     
        // Variables declaration - do not modify                     
        private javax.swing.JButton jButton1;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTextArea jTextArea1;
        private javax.swing.JButton jButton5;
        // End of variables declaration                   
     
     
     
    	class Task extends SwingWorker<Void, Void>{
     
    		@Override
    		protected Void doInBackground() throws Exception {
     
    			return null;
    		}
     
    		public void done(){
     
    			jTextArea1.setText("Number of calls not case :"+getSommeechec()+"\n"+"Number of calls:"+getSommesuc()+"\n"+"Number of failed calls:"+getSommefailed());
     
     
    		}
     
    	}
     
     
     
    }
     
        public ArrayList<String> getLisnom() {
            return lisnom;
        }
     
        public ArrayList<String> getLisnp() {
            return lisnp;
        }
     
        public ArrayList<String> getLisnomedit() {
            return lisnomedit;
        }
     
        public ArrayList<String> getLisnomexcel() {
            return lisnomexcel;
        }
     
        public ArrayList<String> getLisfun() {
            return lisfun;
     
     
     
        }
     
     
    private void jButton5ActionPerformed(java.awt.event.ActionEvent evt) {    //bouton Solution1                                     
            // TODO add your handling code here:
     
       Solution1 sol=  new Solution1(this,getEx());
     
     
     
        }
     
        public Exemple getEx() {
            return this.ex;
        }
     
    }
    le code la classe Exemple pour récuperer la liste
    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
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
     
    import java.awt.Color;
    import java.awt.Dimension;
    import java.awt.Font;
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Point;
    import java.awt.event.ActionEvent;
    import java.awt.event.ActionListener;
    import java.awt.event.MouseAdapter;
    import java.awt.event.MouseEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.awt.geom.Point2D;
    import java.awt.geom.Rectangle2D;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileInputStream;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.IOException;
    import java.io.InputStream;
    import java.io.InputStreamReader;
    import java.util.ArrayList;
    import java.util.Iterator;
    import java.util.List;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.JButton;
    import javax.swing.JDialog;
    import javax.swing.JFileChooser;
     
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JOptionPane;
    import javax.swing.JPanel;
    import javax.swing.JScrollPane;
    import javax.swing.JTable;
    import javax.swing.JTextArea;
    import javax.swing.ListModel;
    import javax.swing.SpringLayout;
    import javax.swing.SwingConstants;
    import javax.swing.SwingUtilities;
    import javax.swing.SwingWorker;
    import javax.swing.event.ListSelectionEvent;
    import javax.swing.event.ListSelectionListener;
    import javax.swing.table.DefaultTableModel;
    import org.apache.poi.EncryptedDocumentException;
    import org.apache.poi.openxml4j.exceptions.InvalidFormatException;
    import org.jdom2.JDOMException;
     
    public class Exemple extends JPanel  {
     
    private static Exemple exemple;
     
    Fenetre3 fen;
    int sommesuc=0,sommeechec=0,sommefailed=0;
     
     ArrayList<String> lisnom=new ArrayList<String>();
         ArrayList<String> lisnp=new ArrayList<String>();
     
     
    public Exemple(Fenetre3 fen) {
            this.fen=fen;
     
     
     
            JButton btnNewButton_1 = new JButton("Save and Analyze");
             btnNewButton_1.addActionListener(new ActionListener() {
     
     
          @Override
          public void actionPerformed(ActionEvent e) {
          Worker work=new Worker();
          work.execute();
     
     
     
          }
            });
     
            btnNewButton_1.setBounds(690, 90, 144, 38);
            add(btnNewButton_1);
     
     
     
      public void save1(ArrayList<String> liste,String pathtoExplore) throws IOException, JDOMException, FileNotFoundException, EncryptedDocumentException, InvalidFormatException{//la methode save1 ou elle contient la liste que je vais la récuperer dans la classe Solution()
     
     
          ArrayList<String> result1= fen.getListname();
         ArrayList<String> result=fen.getListepath();
          ListModel<File> model2=fen.getModell();
         for(int i=0;i<model2.getSize();i++){
     
     
             Lister_path diskFileExplorer = new Lister_path(model2.getElementAt(i).toString(),true);
        ArrayList<String> list= diskFileExplorer.Lister_path();
     
            for(int j=0;j<list.size();j++){
            result.add(list.get(j));}}
                    int l=0,row=0,i=0,h=0;
             DefaultTableModel   tableModel=    fen.getmodel();
     
     
            while(i< result.size()&& l<result1.size()&& h<model2.getSize()){
            String nompath=result.get(i);
            System.out.println(result1.get(l));
            Reader_xml read=new Reader_xml();
        ArrayList<String> listabreg=  read.getName(nompath);
        ArrayList<String> listfunction=  read.getfunction(nompath);
        System.out.println(listabreg);
     
            ReadExeLS reedexel=new ReadExeLS();
                 ArrayList<String> lisn=reedexel.ReadEx(liste);
                 ArrayList<String> lisfun=reedexel.getListefunction();
                 System.out.println(lisn);
     
                 int j=0,k=0, S=0;
     
                while(k<lisn.size()&&j<listabreg.size()&&k<lisfun.size()&&j<listfunction.size()){
     
                    if((lisn.get(k)).equalsIgnoreCase(listabreg.get(j))&&(lisfun.get(k).equalsIgnoreCase(listfunction.get(j)))){
                     S++;k++;j=0;
                        System.out.println(S);
     
                    }else{System.out.println(S);j++;if(j==listabreg.size()){j=0;k++;}else{System.out.println(S);}}}
     
     
            if(S==0){
     
     
     
     
                 tableModel.addRow(new String[]  {"","",""});
                tableModel.setValueAt(result1.get(l), row, 0);
     
                   l++;row++;i++;h++;
                   sommeechec++;
     
     
     
     
            }else if(S==lisn.size()){
     
     
             tableModel.addRow(new String[]  {"","",""});
           tableModel.setValueAt(result1.get(l), row, 1);
     
     
     
        sommesuc++;
            l++;row++; i++;h++;}
            else{
     
             tableModel.addRow(new String[]  {"","",""});
     
           tableModel.setValueAt(result1.get(l), row, 2);
     
         lisnom.add(model2.getElementAt(h).toString());//nom repertoire
         lisnp.add(result.get(i));//nom path
     
        sommefailed++;
            l++;row++;i++;h++;}
     
     
            System.out.println(lisnp);
     
     
            }new StatistiqueDialog();}
     
    public void editor(String path,ArrayList<String>lis) throws IOException, FileNotFoundException, InvalidFormatException{
      ArrayList<String> lisnom=new ArrayList<String>();
        try {
            Saveeditorrr inst =new Saveeditorrr();
            inst.save(lis, path);
     
     
                                    } catch (Exception ex) {
                                  Logger.getLogger(Fenetre3.class.getName()).log(Level.SEVERE, null, ex);
                                                        }
                         FileReader file = null;
     
     
     
                         try{
                             InputStream flux=new FileInputStream(path);
                             InputStreamReader lecture=new InputStreamReader(flux);
                             BufferedReader buff=new BufferedReader(lecture);
                             String ligne;
                             while ((ligne=buff.readLine())!=null){
     
                               lisnom.add(ligne);
                             }
                             buff.close();
                         }
                         catch (Exception e){
                             System.out.println(e.toString());
                         }
     
                       String path2=  System.getProperty("user.home").toString().concat("\\").concat("sena.txt");
                       System.out.println(path2);
                       Saveeditor inst2=new Saveeditor();
                       inst2.save(lisnom, path2);
                        file = new FileReader(path2);
                        BufferedReader br=new BufferedReader(file);
                        try {
                            fen.jTextArea2.read(br,null);
     
                        } catch (IOException e) {
                             // TODO Auto-generated catch block
                            e.printStackTrace();
                        }
     
    }
    public class Worker extends SwingWorker<Void, Void>{
     
            //@Override
            protected Void doInBackground() throws Exception {
                 ArrayList<String>liste= getArrowTexts();
     
                 JFrame frame= fen.getFrame1();
     
     
               frame.getContentPane().removeAll();
               frame.getContentPane().add(new Exemple(fen));
              frame.setTitle("Editeur graphique");
                 frame.dispose();
                 JFrame parentFrame = new JFrame();
     
    JFileChooser fileChooser = new JFileChooser();
    fileChooser.setDialogTitle("Specify a file to save");   
     
    int userSelection = fileChooser.showSaveDialog(parentFrame);
     
    if (userSelection == JFileChooser.APPROVE_OPTION) {
        File fileToSave = fileChooser.getSelectedFile();
        System.out.println("Save as file: " + fileToSave.getAbsolutePath());
     
     
     
                 editor(fileToSave.getAbsolutePath(), liste);
                      fen.progressBar.setIndeterminate(true);
    				fen.progressBar.setVisible(true);
    		 save1(liste, fen.getPathret());
    }else {
                System.out.println("No Selection ");
            }
     
     
            //To change body of generated methods, choose Tools | Templates.
                return null;
            }
     
           // @Override
            public void done(){
     
    			fen.progressBar.setVisible(false);
     
    		}
     
     
    }
     
     
     
    public class StatistiqueDialog extends javax.swing.JDialog {
    private Task task;
        /**
         * Creates new form StatistiqueDialog
         */
        public StatistiqueDialog() {
            initComponents();
            task = new Task();
    		task.execute();
    		this.setVisible(true);
        }
     
        /**
         * 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.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
     
            jPanel1 = new javax.swing.JPanel();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTextArea1 = new javax.swing.JTextArea();
            jButton1 = new javax.swing.JButton();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Résultats d'analyse : Statistiques");
            setPreferredSize(new java.awt.Dimension(450, 360));
            getContentPane().setLayout(null);
     
            jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel1.setPreferredSize(new java.awt.Dimension(450, 360));
            jPanel1.setLayout(new java.awt.BorderLayout());
     
            jTextArea1.setColumns(20);
            jTextArea1.setFont(new java.awt.Font("Tahoma", 0, 13)); // NOI18N
            jTextArea1.setRows(5);
            jTextArea1.setSelectionColor(new java.awt.Color(255, 255, 255));
            jScrollPane1.setViewportView(jTextArea1);
     
            jPanel1.add(jScrollPane1, java.awt.BorderLayout.CENTER);
     
            getContentPane().add(jPanel1);
            jPanel1.setBounds(0, 0, 430, 290);
     
            jButton1.setText("Fermer");
            jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    jButton1ActionPerformed(evt);
                }
            });
            getContentPane().add(jButton1);
            jButton1.setBounds(10, 290, 90, 30);
     
            pack();
        }// </editor-fold>                        
     
        private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
            task.cancel(true);
    		StatistiqueDialog.this.dispose();
        }                                        
     
        /**
         * @param args the command line arguments
         */
     
     
        // Variables declaration - do not modify                     
        private javax.swing.JButton jButton1;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JTextArea jTextArea1;
        // End of variables declaration                   
     
     
     
    	class Task extends SwingWorker<Void, Void>{
     
    		@Override
    		protected Void doInBackground() throws Exception {
     
    			return null;
    		}
     
    		public void done(){
     
    			jTextArea1.setText("Number of calls not case :"+getSommeechec()+"\n"+"Number of calls:"+getSommesuc()+"\n"+"Number of failed calls:"+getSommefailed());
     
     
    		}
     
    	}
     
     
     
    }
     
     
     
     
        public int getSommesuc() {
            return sommesuc;
        }
     
        public int getSommeechec() {
            return sommeechec;
        }
     
        public int getSommefailed() {
            return sommefailed;
        }
     
        public ArrayList<String> getLisnom() {
            return lisnom;
        }
     
        public ArrayList<String> getLisnp() {
            return lisnp;
        }
     
     
     
     
    }
    Voici le code de classe Solution1
    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
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
    361
    362
    363
    364
    365
    366
    367
    368
    369
    370
    371
    372
    373
    374
    375
    376
    377
    378
    379
    380
    381
    382
    383
    384
    385
    386
    387
    388
    389
    390
    391
    392
    393
    394
    395
    396
    397
    398
    399
    400
    401
    402
    403
    404
    405
    406
    407
    408
    409
    410
    411
    412
    413
    414
    415
    416
    417
    418
    419
    420
    421
    422
    423
    424
    425
    426
    427
    428
    429
    430
    431
    432
    433
    434
    435
    436
    437
    438
    439
    440
    441
    442
    443
    444
    445
    446
    447
     
    import java.awt.Dimension;
    import java.awt.Font;
    import static java.awt.Frame.MAXIMIZED_BOTH;
    import java.awt.event.ActionEvent;
    import java.awt.event.WindowAdapter;
    import java.awt.event.WindowEvent;
    import java.io.BufferedReader;
    import java.io.BufferedWriter;
    import java.io.File;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.io.FileWriter;
    import java.io.IOException;
    import java.util.ArrayList;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    import javax.swing.DefaultListCellRenderer;
    import javax.swing.DefaultListModel;
    import javax.swing.JDialog;
    import javax.swing.JFrame;
    import javax.swing.JLabel;
    import javax.swing.JList;
    import javax.swing.ListSelectionModel;
    import org.jdom2.JDOMException;
     
    /*
     * To change this license header, choose License Headers in Project Properties.
     * To change this template file, choose Tools | Templates
     * and open the template in the editor.
     */
     
    /**
     *
     * @author W.S.I
     */
    public class Solution1 extends JDialog {
     private javax.swing.JList<File> jList2;
     private javax.swing.JList<String> jList3;
     Fenetre3 fen;
     Exemple ex;
             String path;
    String nom;
    String nammelist2;
    ArrayList<String> listmanamessg=new ArrayList<String>();
        /**
         * Creates new form Solution
         */
        public Solution1(Fenetre3 fen,Exemple ex) {
            initComponents();
            this.fen=fen;
     
           this.ex=ex;
            this.setSize(1366, 740);
     
    		setPreferredSize(new Dimension(640, 640));
    		setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
     
            setVisible(true);
     
     
     
    		 DefaultListModel model = new DefaultListModel<>();
                  ArrayList<String>lispath=   fen.getLisnom();//listepath du frame Fenetre3 
                  ArrayList<String> lisnompath=ex.getLisnp();//listepath du frame exemple qui est vide or dans sa classe n'est pas vide
     
                   if(lispath!=null){
     
                  for(int i=0;i<lispath.size();i++){
                     File file = new File(lispath.get(i));
     
            		model.addElement(file);
     
                           }
     
     
     
             jList2.setModel(model);
             DefaultListModel modl=new DefaultListModel();
             modl.addElement("");
             modl.addElement("");
             jList3.setModel(modl);}else if(lisnompath!=null){for(int i=0;i<lispath.size();i++){
                     File file = new File(lispath.get(i));
     
            		model.addElement(file);
     
                           }
     
     
     
             jList2.setModel(model);
             DefaultListModel modl=new DefaultListModel();
             modl.addElement("");
             modl.addElement("");jList3.setModel(modl);}
     
     
        }
     
        /**
         * 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.
         */
        @SuppressWarnings("unchecked")
        // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
        private void initComponents() {
     jPanel1 = new javax.swing.JPanel();
            jPanel3 = new javax.swing.JPanel();
            jPanel2 = new javax.swing.JPanel();
            jLabel2 = new javax.swing.JLabel();
            jTextField1 = new javax.swing.JTextField();
            jButton1 = new javax.swing.JButton();
            jButton2 = new javax.swing.JButton();
            jPanel4 = new javax.swing.JPanel();
            jSplitPane1 = new javax.swing.JSplitPane();
            jScrollPane2 = new javax.swing.JScrollPane();
     
            jScrollPane3 = new javax.swing.JScrollPane();
     
            jPanel6 = new javax.swing.JPanel();
            jScrollPane1 = new javax.swing.JScrollPane();
            jTextArea1 = new javax.swing.JTextArea();
            jLabel3 = new javax.swing.JLabel();
            jLabel4 = new javax.swing.JLabel();
     
     
     
     
     
            jScrollPane3 = new javax.swing.JScrollPane();
             jList3 = new JList<>();
     
            setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
            setTitle("Solution");
     
            jPanel1.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel1.setLayout(new java.awt.BorderLayout());
            getContentPane().add(jPanel1, java.awt.BorderLayout.PAGE_START);
     
            jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(10, 10, 10, 10));
            jPanel3.setLayout(new java.awt.BorderLayout());
     
            jPanel2.setLayout(null);
     
           // jLabel1.setFont(new java.awt.Font("Tahoma", 0, 36)); // NOI18N
          //  jLabel1.setText("Solution");
          //  jPanel2.add(jLabel1);
          //  jLabel1.setBounds(500, 10, 470, 100);
     
            jLabel2.setText("Suggestion :");
            jPanel2.add(jLabel2);
            jLabel2.setBounds(834, 200, 110, 30);
            jPanel2.add(jTextField1);
          //  jTextField1.setBounds(950, 200, 210, 30);
     jTextField1.setBounds(920, 200, 240, 30);
            jButton1.setText("Update");
            jPanel2.add(jButton1);
            jButton1.setBounds(1173, 200, 80, 30);
    jButton1.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    try {
                        jButton1ActionPerformed(evt);
                    } catch (IOException ex) {
                        Logger.getLogger(Solution1.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (JDOMException ex) {
                        Logger.getLogger(Solution1.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
     
                private void jButton1ActionPerformed(ActionEvent evt) throws IOException, JDOMException {
     
                   String chainelist3= getNom();
                  String ch= jTextField1.getText();
                 // System.out.println(ch);
                  Modifexcel mod=new Modifexcel();
                  mod.ReadEx(chainelist3, ch);
                  System.out.println("do");
     
     
                }
            });
            jButton2.setText("generer rapport");
            jPanel2.add(jButton2);
           // jButton2.setBounds(480, 640, 170, 30);
            jButton2.setBounds(970, 250, 130, 23);
             jButton2.addActionListener(new java.awt.event.ActionListener() {
                public void actionPerformed(java.awt.event.ActionEvent evt) {
                    try {
                        jButton2ActionPerformed(evt);
                    } catch (FileNotFoundException ex) {
                        Logger.getLogger(Solution1.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
     
                private void jButton2ActionPerformed(ActionEvent evt) throws FileNotFoundException {
              FileReader file=null;      
     file = new FileReader("C:\\Users\\W.S.I\\Documents\\NetBeansProjects\\PFE_test\\fichiertrucc.txt");
                        BufferedReader br=new BufferedReader(file);
                        try {
                            jTextArea1.read(br,null);
                          //   
                            // System.out.println("Analyse de senario  en " + (System.currentTimeMillis() - start) + " mses");
                        } catch (IOException e) {
                             // TODO Auto-generated catch block
                            e.printStackTrace();
                        }                
     
    //To change body of generated methods, choose Tools | Templates.
                }
            });
     
            jPanel4.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel4.setLayout(new java.awt.BorderLayout());
     jList2 = new JList();
            jList2.setCellRenderer(new DefaultListCellRenderer() {
                public java.awt.Component getListCellRendererComponent(JList<?> jlist, Object value, int index, boolean selected, boolean focused) {
                    if ( value instanceof File ) {
                        value = ((File)value).getName(); // on ne veut afficher que le nom du dossier
                    }
                    return super.getListCellRendererComponent(jlist, value, index, selected, focused);
                };
            });
            jList2.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
                public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                    jList2ValueChanged(evt);
                }
            });
            jScrollPane2.setViewportView(jList2);
     
            JLabel lblInterfaces = new JLabel("Name of Calls Failed");
            lblInterfaces.setFont(new Font("Tahoma", Font.BOLD, 11));
            jScrollPane2.setColumnHeaderView(lblInterfaces);
     
            jSplitPane1.setLeftComponent(jScrollPane2);
     jList3.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
                public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                    try {
                        jList3ValueChanged(evt);
                    } catch (IOException ex) {
                        Logger.getLogger(Solution1.class.getName()).log(Level.SEVERE, null, ex);
                    } catch (JDOMException ex) {
                        Logger.getLogger(Solution1.class.getName()).log(Level.SEVERE, null, ex);
                    }
                }
            });
            jScrollPane3.setViewportView(jList3);
     
            JLabel lblMarqueurs = new JLabel("Posts");
            lblMarqueurs.setFont(new Font("Tahoma", Font.BOLD, 11));
            jScrollPane3.setColumnHeaderView(lblMarqueurs);
     
            jSplitPane1.setRightComponent(jScrollPane3);
     
            jPanel4.add(jSplitPane1, java.awt.BorderLayout.CENTER);
     
            jPanel2.add(jPanel4);
            jPanel4.setBounds(10, 170, 800, 460);
    jPanel6.setBackground(new java.awt.Color(204, 204, 204));
            jPanel6.setBorder(javax.swing.BorderFactory.createEmptyBorder(5, 5, 5, 5));
            jPanel6.setLayout(new java.awt.BorderLayout());
     
            jTextArea1.setColumns(20);
            jTextArea1.setRows(5);
            jScrollPane1.setViewportView(jTextArea1);
     
            jPanel6.add(jScrollPane1, java.awt.BorderLayout.CENTER);
     
            jPanel2.add(jPanel6);
            jPanel6.setBounds(820, 440, 450, 180);
     
            jLabel3.setIcon(new javax.swing.ImageIcon("C:\\Users\\W.S.I\\Documents\\NetBeansProjects\\PFE_test\\src\\téléchargement.jpg")); // NOI18N
            jPanel2.add(jLabel3);
            jLabel3.setBounds(480, 10, 260, 150);
     
            jLabel4.setIcon(new javax.swing.ImageIcon("C:\\Users\\W.S.I\\Documents\\NetBeansProjects\\PFE_test\\src\\nexuweb-reporting-service-icon.png")); // NOI18N
            jPanel2.add(jLabel4);
            jLabel4.setBounds(920, 210, 210, 260);
     
            jPanel3.add(jPanel2, java.awt.BorderLayout.CENTER);
     
            getContentPane().add(jPanel3, java.awt.BorderLayout.CENTER);
     
     
            pack();
        }// </editor-fold>                        
     
        private void jList2ValueChanged(javax.swing.event.ListSelectionEvent evt) {                                    
            // TODO add your handling code here:
            if ( evt.getValueIsAdjusting() ) {
             DefaultListModel model=  (DefaultListModel) jList3.getModel();
                                  model.clear();
     
                              int k=0;
                                File selectedFile = jList2.getSelectedValue(); // je récupère le File sélectionné dans la JList
     
                                            String select=selectedFile.toString();
                                           nammelist2= selectedFile.getName();
     
                                           ArrayList<String> lisnpath=fen.getLisnp();//liste ddes path
                                     fen.getLisnomedit();//liste de load
                                 fen.getLisnomexcel(); //liste nom excel abreg
                                    fen.getLisfun();
                                         while(k<lisnpath.size()){
                                               System.out.println(lisnpath.get(k));
                                           if(lisnpath.get(k).contains(select)){
     
                                           path=lisnpath.get(k);k=lisnpath.size();
                                           System.out.println(path);
     
                                           }else{k++;System.out.println("introuv");}
     
                                           }
                                        System.out.println(path);  
                                  Workanalyze inst=new Workanalyze();
                                        try {
     
                                     ArrayList<String>  listmess=   inst.dotraitement(fen.getLisnomexcel(), fen.getLisnomedit(), fen.getLisfun(),path );
                                      System.out.println(listmess);
                                       DefaultListModel model1 = new DefaultListModel<>();
                                     //  listMessage
                                       for(int i=0;i<listmess.size();i++){
                                       model1.addElement(listmess.get(i));}
     
     
                            jList3.setModel(model1);
     
     
                                        } catch (IOException ex) {
                                            Logger.getLogger(Solut.class.getName()).log(Level.SEVERE, null, ex);
                                        } catch (JDOMException ex) {
                                            Logger.getLogger(Solut.class.getName()).log(Level.SEVERE, null, ex);
                                        }
     
     
     
     
     
        } }                                  
     
        /**
         * @param args the command line arguments
         */
        public static void main(String args[]) {
            /* Set the Nimbus look and feel */
            //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
            /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
             * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
             */
            try {
                for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                    if ("Nimbus".equals(info.getName())) {
                        javax.swing.UIManager.setLookAndFeel(info.getClassName());
                        break;
                    }
                }
            } catch (ClassNotFoundException ex) {
                java.util.logging.Logger.getLogger(Solution.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (InstantiationException ex) {
                java.util.logging.Logger.getLogger(Solution.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (IllegalAccessException ex) {
                java.util.logging.Logger.getLogger(Solution.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            } catch (javax.swing.UnsupportedLookAndFeelException ex) {
                java.util.logging.Logger.getLogger(Solution.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
            }
            //</editor-fold>
     
            /* Create and display the form */
     
        }
     
        // Variables declaration - do not modify   
     
           private javax.swing.JButton jButton1;
        private javax.swing.JButton jButton2;
        private javax.swing.JLabel jLabel2;
        private javax.swing.JLabel jLabel3;
        private javax.swing.JLabel jLabel4;
        private javax.swing.JPanel jPanel1;
        private javax.swing.JPanel jPanel2;
        private javax.swing.JPanel jPanel3;
        private javax.swing.JPanel jPanel4;
        private javax.swing.JPanel jPanel6;
        private javax.swing.JScrollPane jScrollPane1;
        private javax.swing.JScrollPane jScrollPane2;
        private javax.swing.JScrollPane jScrollPane3;
        private javax.swing.JSplitPane jSplitPane1;
        private javax.swing.JTextArea jTextArea1;
        private javax.swing.JTextField jTextField1;
     
     
     
     
      public class Workanalyze {
     
       public ArrayList<String> dotraitement(ArrayList<String> nom,ArrayList<String> lisnome,ArrayList<String> function,String path) throws IOException, JDOMException{
     
          Reader_xml read=new Reader_xml();
        ArrayList<String> listabreg=  read.getName(path);
        ArrayList<String> listfunction=  read.getfunction(path);
        int j=0,k=0, l=0;
     
                while(k<nom.size()&&j<listabreg.size()&&k<function.size()&&j<listfunction.size()&&l<lisnome.size()){
     
                    if((nom.get(k)).equalsIgnoreCase(listabreg.get(j))&&(function.get(k).equalsIgnoreCase(listfunction.get(j)))){
                  l++;  k++;j=0;
     
     
                    }else{j++;if(j==listabreg.size()){j=0;listmanamessg.add(lisnome.get(l));System.out.println(lisnome.get(l));k++;l++;}else{System.out.println("ccc");}}}
           return listmanamessg;
    }
     
    }
     private void jList3ValueChanged(javax.swing.event.ListSelectionEvent evt) throws IOException, JDOMException {                                    
            // TODO add your handling code here:
            if ( evt.getValueIsAdjusting() ) {
     
               nom= jList3.getSelectedValue();
            //  System.out.println(nom);
             ReadExcelsol inst=new ReadExcelsol();
            String chaine= inst.ReadEx(nom);
            jTextField1.setText(chaine);
            String fieled=jTextField1.getText();
     
     
            String ligne=getNammelist2()+"                 " +getNom()+"                  "+fieled ;
     
     
           TextFileWriter.append("fichiertrucc.txt",ligne );
     
            System.out.println("cc");
     
     
            }
     
        } 
     
        public String getNom() {
            return nom;
        }
     
        public String getNammelist2() {
            return nammelist2;
        }
     
     
     
    }
    Merci d'avance pour vos réponses

  10. #10
    Expert éminent sénior
    Avatar de tchize_
    Homme Profil pro
    Ingénieur développement logiciels
    Inscrit en
    Avril 2007
    Messages
    25 481
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 44
    Localisation : Belgique

    Informations professionnelles :
    Activité : Ingénieur développement logiciels
    Secteur : High Tech - Éditeur de logiciels

    Informations forums :
    Inscription : Avril 2007
    Messages : 25 481
    Points : 48 806
    Points
    48 806
    Par défaut
    vu que le seul endroit où cette liste est remplie, c'est dans save1, es-tu sur de cliquer sur ton bouton save avant ton bouton solutions? Le println que tu as mis de la liste dans save1, il t'affiche quelque chose?

  11. #11
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Décembre 2016
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Décembre 2016
    Messages : 19
    Points : 20
    Points
    20
    Par défaut
    Citation Envoyé par tchize_ Voir le message
    vu que le seul endroit où cette liste est remplie, c'est dans save1, es-tu sur de cliquer sur ton bouton save avant ton bouton solutions? Le println que tu as mis de la liste dans save1, il t'affiche quelque chose?


    oui;je suis sur de cliquer au bouton save avant bouton Solution;et pour la liste elle m'affiche le résultat que j'ai besoin;
    ok maintenant pour dans la classe Fenetre3 vous m'avez dit de faire comme ça
    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
    public class Fenetre3 extends javax.swing.JFrame {
     JFileChooser chooser = new JFileChooser();
    ArrayList<String> resultt ;
    String lastPathList;
    String pathload;
     ArrayList<String> lisfun=new ArrayList<>();
    int sommesuc=0,sommeechec=0,sommefailed=0;
    JFrame frame1 = new JFrame();
     ArrayList<String> lis=new ArrayList<String>();
    ArrayList<String> listrep=new ArrayList<String>();
     javax.swing.JTable jTable1;
     javax.swing.JTextArea jTextArea2;
    ArrayList<String>listnam=new ArrayList<String>();
    File fil;
     JProgressBar progressBar = new JProgressBar();
     ArrayList<String> lisnom=new ArrayList<String>();
         ArrayList<String> lisnp=new ArrayList<String>();
       ArrayList<String>lisnomedit=new ArrayList<String>();
        Icon icone=new ImageIcon("recherch.png"); 
     DefaultTableModel  model = new DefaultTableModel();
     ArrayList<String> lisnomexcel=new ArrayList<String>();
    String pathret;
    ArrayList<String> listepath=new ArrayList<String>();
    ArrayList<String>listname=new ArrayList<String>();
    ListModel<File> modell;
    ArrayList<String>listnomtextarea=new ArrayList<String>();
        /**
         * Creates new form Fenetre
         */
        String choosertitle;
     
     Exemple ex;
     
        /**
         * Creates new form Fenetre
         */
     
     
        public Fenetre3() {
         this.ex=new Exemple(this);
            initComponents();
     
     
                      setIcon();
            //pour la dimension de la fenetre soit la meme pour l'ecran
                    setExtendedState(MAXIMIZED_BOTH);
    		setPreferredSize(new Dimension(640, 640));
    		setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    		setBounds(100, 100, 640, 470);
     
     
        }
    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) throws IOException, FileNotFoundException, EncryptedDocumentException, InvalidFormatException, BadLocationException {
     
       DefaultTableModel model1=getmodel();
       getmodel().getDataVector().removeAllElements();
     ArrayList lisnom=getLisnomedit();
     System.out.println(lisnom);
     Exemple ex1=getEx();
    ArrayList<String> lis=ex1.getListe1();//pour ça aussi il m'affiche null;par contre c'est pas null dans ca classe
    System.out.println(lis);}
    public Exemple getEx() {
            return this.ex;
        }}
    normalement c'est le problème pour la référence ex qu'elle retourne toujours null

  12. #12
    Membre à l'essai
    Femme Profil pro
    Étudiant
    Inscrit en
    Décembre 2016
    Messages
    19
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 32
    Localisation : Tunisie

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Décembre 2016
    Messages : 19
    Points : 20
    Points
    20
    Par défaut
    J'ai résolu le probleme maintenant

    merci à vous

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. « Java pour les enfants » consultable en ligne !
    Par Mickael Baron dans le forum Programmation pour enfants
    Réponses: 140
    Dernier message: 23/08/2018, 18h04
  2. Un lecteur de Streaming JAVA pour les flux OGG
    Par kmdkaci dans le forum Mon programme
    Réponses: 1
    Dernier message: 10/10/2011, 01h23
  3. Gérer le cache de Java pour les images
    Par JavaMan77 dans le forum Applets
    Réponses: 0
    Dernier message: 14/12/2008, 23h49
  4. [rouillé]équivalent contains Java pour les vector C++?
    Par Mr Pink Eyes dans le forum SL & STL
    Réponses: 10
    Dernier message: 29/12/2007, 22h43

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo