コード例 #1
0
 /** 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);
   }
 }
コード例 #2
0
  /**
   * 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;
  }