diff --git a/BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.class b/BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.class index ef761fa..8c9511e 100644 Binary files a/BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.class and b/BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.class differ diff --git a/BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.java b/BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.java index 13441fe..94dd5b7 100644 --- a/BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.java +++ b/BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.java @@ -29,7 +29,7 @@ public class exo1 { Groupe.add(boutonRadio4); // on ajoute le composant dans la fenetre, au milieu - GridLayout gestionnaire = new GridLayout(1, 4); + GridLayout gestionnaire = new GridLayout(4,4); fenetre.setLayout(gestionnaire); fenetre.add(boutonRadio1); fenetre.add(boutonRadio2); diff --git a/BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.class b/BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.class new file mode 100644 index 0000000..f535291 Binary files /dev/null and b/BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.class differ diff --git a/BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.java b/BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.java new file mode 100644 index 0000000..24dd1f6 --- /dev/null +++ b/BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.java @@ -0,0 +1,35 @@ +import javax.swing.*; +import java.awt.*; + +public class exo2{ + public static void main(String[] args){ + // Création d'une fenêtre + configuration + JFrame fenetre = new JFrame(); + fenetre.setSize(500, 500); + + // Conversion de la taille donnée en argument en INT + int nombre = Integer.parseInt(args[0]); + + GridLayout gestionnaire = new GridLayout(nombre,nombre); + JPanel[] bouton = new JPanel[nombre*nombre]; + + for (int i = 0; i < nombre * nombre; i++) { + bouton[i] = new JPanel(); + + int ligne = i / nombre; + int colonne = i % nombre; + + if ((ligne + colonne) % 2 == 0) { + bouton[i].setBackground(Color.WHITE); + } else { + bouton[i].setBackground(new Color(51,249,255)); + } + + fenetre.add(bouton[i]); + } + + // Affichage de la fenêtre + fenetre.setLayout(gestionnaire); + fenetre.setVisible(true); + } +} \ No newline at end of file diff --git a/BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.class b/BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.class new file mode 100644 index 0000000..c24fbc0 Binary files /dev/null and b/BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.class differ diff --git a/BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.java b/BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.java new file mode 100644 index 0000000..633bedd --- /dev/null +++ b/BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.java @@ -0,0 +1,32 @@ +import javax.swing.*; +import java.awt.*; + +public class exo3 { + public static void main(String[] args) { + JFrame fenetre = new JFrame(); + fenetre.setSize(500, 300); + fenetre.setLocation(300, 300); + + JPanel panneauBouton = new JPanel(); + JPanel panneauPrincipal = new JPanel(); + + + JLabel texte = new JLabel("Aimez-vous les chiens ?"); + + + JButton bouton1 = new JButton("Oui"); + panneauBouton.add(bouton1); + JButton bouton2 = new JButton("Non"); + panneauBouton.add(bouton2); + JButton bouton3 = new JButton("NSPP"); + panneauBouton.add(bouton3); + + panneauPrincipal.add(texte, BorderLayout.CENTER); + panneauPrincipal.add(panneauBouton, BorderLayout.SOUTH); + + + + fenetre.add(panneauPrincipal, BorderLayout.CENTER); + fenetre.setVisible(true); + } +} diff --git a/BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.class b/BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.class new file mode 100644 index 0000000..3536854 Binary files /dev/null and b/BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.class differ diff --git a/BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.java b/BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.java new file mode 100644 index 0000000..49f8fa0 --- /dev/null +++ b/BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.java @@ -0,0 +1,15 @@ +import javax.swing.*; +import java.awt.*; + +public class exo4{ + public static void main(String[] args){ + JFrame fenetre = new JFrame(); + fenetre.setSize(600,400); + fenetre.setLocation(300,300); + + + GridLayout gestionnaire = new GridLayout(3,0); + + fenetre.setVisible(true); + } +} \ No newline at end of file