Exemplo n.º 1
0
 @Override
 public void mousePressed(MouseEvent e) {
   TreePath[] liste = arbre.getSelectionPaths();
   for (TreePath path : liste) {
     if (path.getLastPathComponent() instanceof Feuille) {
       Feuille feuille = (Feuille) path.getLastPathComponent();
       StringBuffer buffer = new StringBuffer(feuille.getNom());
       try {
         while (bdd.enregistrementExist(buffer.toString())) {
           buffer.append(".copie");
         }
         bdd.ajouterEnregistrement(
             buffer.toString(),
             feuille.getDuree(),
             feuille.getIdCategorie(),
             bdd.recupererEnregistrement(feuille.getId()),
             feuille.getIdSujet());
       } catch (DBException e1) {
         GraphicalUserInterface.popupErreur(e1.getLocalizedMessage());
       }
     }
   }
 }