29 lines
722 B
Java
29 lines
722 B
Java
import java.awt.*;
|
|
import javax.swing.*;
|
|
|
|
public class Fenetre extends JFrame {
|
|
public Fenetre() {
|
|
this.setSize(700, 100);
|
|
this.setLocation(100, 100);
|
|
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
this.setLayout(new GridLayout(1, 10));
|
|
|
|
Cercle[] tabCercles = new Cercle[10];
|
|
|
|
for (int i = 0; i != 5; i++) {
|
|
Cercle nouveauCercle = new Cercle(Color.ORANGE);
|
|
this.add(nouveauCercle);
|
|
tabCercles[i] = nouveauCercle;
|
|
}
|
|
|
|
for (int i = 5; i != 10; i++) {
|
|
Cercle nouveauCercle = new Cercle(Color.LIGHT_GRAY);
|
|
this.add(nouveauCercle);
|
|
tabCercles[i] = nouveauCercle;
|
|
}
|
|
|
|
MoletteSouris gestionSouris = new MoletteSouris(this, tabCercles);
|
|
this.addMouseWheelListener(gestionSouris);
|
|
}
|
|
|
|
} |