salut !
J'ai un problème pour afficher le contenu d'une liste
voila mon constructeur
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
public class synchrone implements composition{
 
    Transition td1;
    Transition td2;
    ArrayList<Transition>t_f1=new ArrayList();
    ArrayList<Transition>t_f2=new ArrayList();
    ArrayList<String> rel=new ArrayList();
String type;
    private int i=0;
    public synchrone() {
    }
 
 
    public synchrone(Transition td, Transition tf) {
        this.td1 = td;
        this.td2 = tf;
    }
 
     public synchrone(String t, ArrayList<String> r,Transition td, Transition tf,ArrayList<Transition>trd,ArrayList<Transition>trf) {
        this.td1 = td;
        this.td2 = tf;
        this.t_f1=trd;
        this.t_f2=trf;
        this.type=t;
        this.rel=r;
    }
et voici mon bout de code pour l'affichage

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
public class AjouterComposition extends javax.swing.JFrame {
ArrayList<synchrone >  cmpt = new ArrayList();
          ArrayList<Transition> tfin1=new ArrayList();
          ArrayList<Transition> tfin2=new ArrayList();
          ArrayList<String> rel=new ArrayList();





          String t;
          synchrone sy=new synchrone();

         int i;
         String s,s1,s2;
         Transition  tdeb1;
         Transition  tdeb2;

private void jButton6ActionPerformed(java.awt.event.ActionEvent evt) {                                         

    cmpt.add(new synchrone(t,rel,tdeb1,tdeb2,tfin1,tfin2));

}      

// affichage

void Afficher()
    { String titre="Les classe et les domaine";
      String message="";
      for(i=0;i<cmpt.size();i++)
      { 
        message+="le type du composition: \t\t "+ cmpt.get(i).getType();
        message+="\n\n";
         message+="swn de composition: ";
       for(int n=0;n<rel.size();n++)
        { message+=", "+ cmpt.get(n).getSWN();}
        message+="\n\n";
        message+="les transition de fin de N1: ";
           for(int j=0;j<sy.t_f1.size();j++)
           {  message+=", "+ sy.t_f1.get(j).getNom();}
                message+="\n\n"; 
                
                message+="les transition de fin de N2:  ";
                           for(int r=0;r<sy.t_f2.size();r++)

                 { message+=", "+ sy.t_f2.get(r).getNom();}        
                   message+="\n\n";
                   message+="la transition de début N1: \t\t "+ cmpt.get(i).getTd1().getNom();
                   message+="\n\n";
                   message+="la transition de début N2: \t\t "+ cmpt.get(i).getTd2().getNom();
                                        //message+="les swn: \t\t "+ cmpt.get(i).getSWN();
                        message+="\n\n";
message+="\n\n";



        message+="******************************************************************";
        message+="\n\n";
      }
     
      
    javax.swing.JOptionPane.showMessageDialog(this,
                        
            message,titre,
            javax.swing.JOptionPane.INFORMATION_MESSAGE);
    }
en rouge c'est faux, je sais pas comment afficher les liste tfin1 et tfin2 et rel qui se trouve dans la liste cmpt
merci