MAJ
This commit is contained in:
parent
1faeb92890
commit
8723822304
Binary file not shown.
@ -29,7 +29,7 @@ public class exo1 {
|
|||||||
Groupe.add(boutonRadio4);
|
Groupe.add(boutonRadio4);
|
||||||
|
|
||||||
// on ajoute le composant dans la fenetre, au milieu
|
// 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.setLayout(gestionnaire);
|
||||||
fenetre.add(boutonRadio1);
|
fenetre.add(boutonRadio1);
|
||||||
fenetre.add(boutonRadio2);
|
fenetre.add(boutonRadio2);
|
||||||
|
BIN
BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.class
Normal file
BIN
BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.class
Normal file
Binary file not shown.
35
BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.java
Normal file
35
BUT1/DEV2.2/TP3-MiseEnPage/EXO2/exo2.java
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
BIN
BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.class
Normal file
BIN
BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.class
Normal file
Binary file not shown.
32
BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.java
Normal file
32
BUT1/DEV2.2/TP3-MiseEnPage/EXO3/exo3.java
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
BIN
BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.class
Normal file
BIN
BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.class
Normal file
Binary file not shown.
15
BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.java
Normal file
15
BUT1/DEV2.2/TP3-MiseEnPage/EXO4/exo4.java
Normal file
@ -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);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user