Passage du main a une fonction d'une interface

Fermé
aaaaaaa! Messages postés 3 Date d'inscription jeudi 21 avril 2016 Statut Membre Dernière intervention 22 avril 2016 - Modifié par KX le 22/04/2016 à 21:53
Bonjour,

J'ai créé un tableau regourpant pour chaque film a ensemble de fichier.
Comment puis-je utiliser ce tableau pr le transmettre en paramètre dans mon bouton à la placede tout refaire ?
Voici une partie du code de mon interface :
le f3 du jbutton3 n'est pas reconnu.
le l du jbutton2 n'est pas recconnu.
le jbutton1 action performed transmet bien les fichier

    private void jButton3ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        Interface_Film ihm = new Interface_Film(f3.getimage(),f3.getPresentation(), f3.getSynopsis());
        ihm.setVisible(true);
        this.setVisible(false);
    }                                        

    private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        Interface_Film ihm = new Interface_Film(l.get(2));

        ihm.setVisible(true);
        this.setVisible(false);
    }                                        

    private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {                                         
        // TODO add your handling code here:
        Interface_Film ihm = new Interface_Film("src\\film\\Affiche_film\\Avatar.jpg", "src\\film\\Description\\Avatar.txt");
        ihm.setVisible(true);
        this.setVisible(false);
    }                                        

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {                                      

    }                                     

    /**


* @param args the command line arguments

*/
    
                                

    public static void main(String args[]) {

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(() -> {
            new Interface_Accueil().setVisible(true);
        });
        
// création d'un film en paramètre des fichiers

Film f1 = new Film ("src\\film\\Affiche_film\\Avatar.jpg","src\\film\\Presentation\\AvatarP.txt","src\\film\\Description\\Avatar.txt");

Film f2 = new Film ("src\\film\\Affiche_film\\_300.jpg","src\\film\\Presentation\\_300P.txt","src\\film\\Description\\_300.txt");

Film f3 = new Film ("src\\film\\Affiche_film\\Avengers.jpg","src\\film\\Presentation\\AvengersP.txt","src\\film\\Description\\Avengers.txt");

Film f4 = new Film ("src\\film\\Affiche_film\\Combats_De_Maitre.jpg","src\\film\\Presentation\\Combats_De_MaitreP.txt","src\\film\\Description\\Combats_De_Maitre.txt");

Film f5 = new Film ("src\\film\\Affiche_film\\La_Ligue_Des_Gentlemen_Extraordinaires.jpg","src\\film\\Presentation\\La_Ligue_Des_Gentlemen_ExtraordinairesP.txt","src\\film\\Description\\La_Ligue_Des_Gentlemen_Extraordinaires.txt");

Film f6 = new Film ("src\\film\\Affiche_film\\Il_Faut_Sauver_Le_Soldat_Ryan.jpg","src\\film\\Presentation\\Il_Faut_Sauver_Le_Soldat_RyanP.txt","src\\film\\Description\\Il_Faut_Sauver_Le_Soldat_Ryan.txt");

création d'un tableau de film
List l = new LinkedList();
l.add(f1);
l.add(f2);
l.add(f3);
l.add(f4);
l.add(f5);
l.add(f6);