This commit is contained in:
Simoes Lukas
2025-03-11 10:02:42 +01:00
parent 9441c8978a
commit 2a0aa37baa
47 changed files with 561 additions and 3 deletions

View File

@@ -0,0 +1,22 @@
import java.awt.*;
import javax.swing.*;
public class DeclinaisonsMain {
public static void main(String[] args) {
JFrame fenetre = new JFrame();
fenetre.setSize(300, 300);
fenetre.setLocation(100, 100);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
fenetre.setLayout(new GridLayout(2, 2));
JPanel[] panneaux = {new JPanel(), new JPanel(), new JPanel(), new JPanel()};
Color[] couleursTriangles = {Color.MAGENTA, Color.YELLOW, Color.CYAN, Color.BLUE};
Color[] couleursFonds = {Color.CYAN, Color.PINK, Color.MAGENTA, Color.YELLOW};
for (int i = 0; i != 4; i++) {
panneaux[i].setBackground(couleursFonds[i]);
panneaux[i].setLayout(new BorderLayout());
panneaux[i].add(new Declinaisons(couleursTriangles[i]), BorderLayout.CENTER);
fenetre.add(panneaux[i]);
}
fenetre.setVisible(true);
}
}