/** This is the default constructor */ public GestionCompte() { super(); initialize(); modelList = new DefaultListModel(); jList.setModel(modelList); // on recupere la liste des comptes et on l'affiche ArrayList<String> lst = BDRequette.getListeDeComptes(); for (String s : lst) { modelList.addElement(s); } }
/** * This method initializes jPopupMenu * * @return javax.swing.JPopupMenu */ private JPopupMenu getJPopupMenu() { if (popUpMenu == null) { popUpMenu = new JPopupMenu(); BDRequette bd = new BDRequette(); MlListeCompteMail lstCpt = bd.getListeDeComptes(); bd.closeConnexion(); if (releveOuSynchro) { popUpMenu.add(creerNouveauItem("Relever tous les comptes")); } else { popUpMenu.add(creerNouveauItem("Synchroniser tous les comptes")); } for (MlCompteMail cpt : lstCpt) { popUpMenu.add(creerNouveauItem(cpt.getNomCompte())); } } return popUpMenu; }