SAE21_2022/FenetreVideGrille.java

39 lines
1.2 KiB
Java

import java.awt.*;
import javax.swing.*;
import javax.swing.border.Border;
public class FenetreVideGrille extends Fenetre{
private int[] tab_de_int;
public FenetreVideGrille(){
super();
this.tab_de_int = new int[] {0, 0};
}
protected void create_empty(int Taille){
this.fenetre.setSize(600, 600);
this.fenetre.setLocation(450, 200);
OptionsFVG un_Test = new OptionsFVG(this);
un_Test.set_up();
GridLayout gestionnaire = new GridLayout(Taille,Taille);
this.fenetre.setLayout(gestionnaire);
for(int i=0; i<Taille; i++){
for(int j=0; j<Taille; j++){
JPanel ce_panel = new JPanel();
Border border = BorderFactory.createLineBorder(Color.BLACK, 1);
ce_panel.setBorder(border);
ce_panel.setBackground(Color.WHITE);
this.fenetre.add(ce_panel);
ModificationsFVG testee = new ModificationsFVG(un_Test, this.tab_de_int);
ce_panel.addMouseListener(testee);
this.tab_de_int=testee.getValues();
}
}
this.fenetre.setVisible(true);
}
}