BUT2/DEV/DEV2.1/TP08_Evenement/Q5_Commande/Fond.java~

19 lines
534 B
Java
Raw Permalink Normal View History

2023-10-23 13:23:36 +02:00
import javax.swing.*;
import java.awt.*;
public class Fond{
public static void main(String[] args) {
JButton boutonCyan = new JButton("Cyan");
JButton boutonMagenta = new JButton("Magenta");
JButton boutonJaune = new JButton("Jaune");
JButton[] boutonList = {boutonCyan,boutonMagenta,boutonJaune};
FondEvent fenetreClass = new FondEvent(boutonList);
fenetreClass.fenetre();
boutonCyan.addActionListener(fenetreClass);
boutonMagenta.addActionListener(fenetreClass);
boutonJaune.addActionListener(fenetreClass);
}
}