import javax.swing.*; import java.awt.*; import java.awt.event.*; public class ActionUtilisateur implements MouseListener{ public JLabel musique; public int identifiant; public static int selection = -1; public ActionUtilisateur(JLabel musique, int identifiant){ this.musique = musique; this.musique.setOpaque(true); this.musique.setBackground(new Color(255,255,255)); this.identifiant = identifiant; } @Override public void mouseClicked(MouseEvent evenement){ System.out.println("clic"); } @Override public void mouseEntered(MouseEvent evenement){ this.musique.setBackground(new Color(100,100,100)); } @Override public void mouseExited(MouseEvent evenement){ this.musique.setBackground(new Color(255,255,255)); } @Override public void mousePressed(MouseEvent evenement){ System.out.println("pressé"); } @Override public void mouseReleased(MouseEvent evenement){ System.out.println("relaché"); } }