cs_Dellys
Messages postés95Date d'inscriptionmercredi 26 octobre 2005StatutMembreDernière intervention24 mars 2008
-
24 mars 2008 à 10:47
cs_Dellys
Messages postés95Date d'inscriptionmercredi 26 octobre 2005StatutMembreDernière intervention24 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();
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 -->
cs_Dellys
Messages postés95Date d'inscriptionmercredi 26 octobre 2005StatutMembreDernière intervention24 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" /??>