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

40 lines
960 B
Java
Raw Normal View History

2023-10-23 13:23:36 +02:00
import javax.swing.*;
import java.awt.*;
import java.awt.event.*;
public class ActionIndividus implements MouseListener{
public JLabel musique;
public boolean isActived;
public ActionIndividus(JLabel musique){
this.musique = musique;
this.musique.setOpaque(true);
this.musique.setBackground(new Color(255,255,255));
}
@Override
public void mouseClicked(MouseEvent evenement){
this.musique.setBackground(new Color(100,255,0));
this.isActived = true;
}
@Override
public void mouseEntered(MouseEvent evenement){
if (this.isActived == false){
this.musique.setBackground(new Color(100,100,100));
}
}
@Override
public void mouseExited(MouseEvent evenement){
if (this.isActived == false){
this.musique.setBackground(new Color(255,255,255));
}
}
@Override
public void mousePressed(MouseEvent evenement){
}
@Override
public void mouseReleased(MouseEvent evenement){
}
}