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
|
public void affichage(Conversation conv)
{
int taille = conv.getConv().size();
JPanel pan = new JPanel();
pan.setLayout(new GridLayout(taille + 3, 1));
JLabel j = new JLabel();
String str="";
for(int i=0;i<conv.getConv().size();i++) // extraction de chaines d'un vector
{
str = (String) conv.getConv().elementAt(i);
// A CHAQUE APPEL DE LA METHODE AFFICHAGE LE CONTENU DU LABEL EST SENCE CHANGER
j.setText(str);
pan.add(j);
}
JTextField text = new JTextField();
pan.add(text);
JButton bouton1 = new JButton(new cltEcho("Valider"));
pan.add(bouton1);
pack();
panel.removeAll();
panel=pan;
panel.updateUI();
panel.setVisible(false);
pan.setVisible(true);
this.add(panel);
}
} |
Partager