BUT2/DEV/DEV2.1/TP09_Evenement2/Q2_Playlist/ActionUtilisateur.java~

39 lines
1000 B
Java
Raw Permalink Normal View History

2023-10-23 13:23:36 +02:00
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é");
}
}