Pb Affichage horizontal jListe

Résolu
cs_Dellys Messages postés 95 Date d'inscription mercredi 26 octobre 2005 Statut Membre Dernière intervention 24 mars 2008 - 24 mars 2008 à 10:47
cs_Dellys Messages postés 95 Date d'inscription mercredi 26 octobre 2005 Statut Membre Dernière intervention 24 mars 2008 - 24 mars 2008 à 16:39
Bonjour,
J’ai un problème en utilisant Model avec jList les donnés s’affiche en horizontal pas en vertical alors sans Model sa s'affiche normalement c'est a dire vertical,c’est quoi le problème Svp ?

voici le code:
DefaultListModel model =new DefaultListModel();
 Vector dataLIST2= new Vector();
 ArrayList IDEXLIST2=new ArrayList();
 ArrayList qteL2=new ArrayList();
 ArrayList ValideL2=new ArrayList();
 JList jList2 = new JList();

 
Try{
 
model.clear();
jList2.removeAll();
dataLIST2.clear();
IDEXLIST2.clear();
qteL2.clear();
ValideL2.clear();

 
connec = getConnec();
Statement reqlist = connec.createStatement();
ResultSet Resultlis = reqlist.executeQuery("SELECT a.id,a.produit,a.valide,b.qte FROM stock.items a LEFT JOIN quantite_cat b ON a.id=id_prod and b.cat='A'");
 

 
 
while(Resultlis.next()){

dataLIST2.add(Resultlis.getString("produit"));
 
IDEXLIST2.add(Resultlis.getString("id"));
 
qteL2.add(Resultlis.getInt("qte"));

ValideL2.add(Resultlis.getString("valide"));
 
 
}
  
model.addElement(dataLIST2);
 
jList2.setModel(model);

Resultlis.close();
}catch(Throwable exception){
 
System.out.println(exception) ;
}
 

<!-- END TEMPLATE: bbcode_code -->
<!-- / message -->, ----
<!-- BEGIN TEMPLATE: postbit_onlinestatus --><!-- END TEMPLATE: postbit_onlinestatus --> , <!-- controls -->

1 réponse

cs_Dellys Messages postés 95 Date d'inscription mercredi 26 octobre 2005 Statut Membre Dernière intervention 24 mars 2008
24 mars 2008 à 16:39
C'est bon j'utilise  jList2.setListData(dataLIST2); pour rafraîchir ma jlist et ça marche<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /??>





Salutations 
3
Rejoignez-nous