BUT2/DEV/DEV2.1/TP08_Evenement/Q3_Radio/FondEvent.java~
2023-10-23 13:23:36 +02:00

29 lines
726 B
Java

import javax.swing.*;
import java.awt.*;
public class FondEvent implements ActionListener{
public JPanel panneau;
public FondEvent(JButton[] boutons){
panneau = new JPanel();
for (JButton bouton : boutons){
panneau.add(bouton);
}
boutonContainer.setBackground(new Color(46,209,111));
}
public void fenetre(){
JFrame fenetre = new JFrame();
fenetre.setSize(500, 300);
fenetre.setLocation(0, 0);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.add(boutonContainer, BorderLayout.CENTER);
fenetre.setVisible(true);
}
@Override
void actionPerformed(ActionEvent evenement){
String couleur = this.getActionCommand();
boutonContainer.setBackground(couleur);
}
}