TP
This commit is contained in:
29
DEV2.1/TP09/01_Volume/Fenetre.java
Normal file
29
DEV2.1/TP09/01_Volume/Fenetre.java
Normal file
@@ -0,0 +1,29 @@
|
||||
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);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user