ajout vieux sujet
This commit is contained in:
parent
edc92ac142
commit
42bb92022a
3
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO2/Manie.java
Normal file
3
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO2/Manie.java
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
public class Manie{
|
||||||
|
|
||||||
|
}
|
Binary file not shown.
@ -1,9 +0,0 @@
|
|||||||
import javax.swing.*;
|
|
||||||
import java.awt.*;
|
|
||||||
|
|
||||||
public class Nuance {
|
|
||||||
private JPanel[] tableauPanneauNuance;
|
|
||||||
public Nuance(){
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
33
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO3/Menu.java
Normal file
33
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO3/Menu.java
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class Menu {
|
||||||
|
private JButton[] boutons;
|
||||||
|
|
||||||
|
public Menu(String args[]) {
|
||||||
|
JFrame fenetre = new JFrame();
|
||||||
|
fenetre.setSize(500,500);
|
||||||
|
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
|
this.boutons = new JButton[args.length];
|
||||||
|
|
||||||
|
JPanel panneau = new JPanel();
|
||||||
|
panneau.setLayout(new GridLayout(args.length, 1));
|
||||||
|
|
||||||
|
int i = 0;
|
||||||
|
for (String element : args) {
|
||||||
|
this.boutons[i] = new JButton(element);
|
||||||
|
panneau.add(this.boutons[i]);
|
||||||
|
i++;
|
||||||
|
}
|
||||||
|
|
||||||
|
fenetre.add(panneau);
|
||||||
|
|
||||||
|
// Utiliser pack() pour ajuster la taille de la fenêtre en fonction des composants
|
||||||
|
fenetre.setVisible(true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
Menu test = new Menu(args);
|
||||||
|
}
|
||||||
|
}
|
BIN
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO3/MenuApp.class
Normal file
BIN
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETA/EXO3/MenuApp.class
Normal file
Binary file not shown.
BIN
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETC/EXO1/EXO1.class
Normal file
BIN
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETC/EXO1/EXO1.class
Normal file
Binary file not shown.
23
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETC/EXO1/EXO1.java
Normal file
23
BUT1/CONTROLE/DEV2.1/Entrainement/SUJETC/EXO1/EXO1.java
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
import java.lang.Math;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
public class EXO1{
|
||||||
|
private double valeur1;
|
||||||
|
private Random random;
|
||||||
|
private double valeur2;
|
||||||
|
|
||||||
|
public EXO1(){
|
||||||
|
valeur1 = Math.random();
|
||||||
|
this.random = new Random();
|
||||||
|
valeur2 = random.nextDouble();
|
||||||
|
}
|
||||||
|
|
||||||
|
public String toString(){
|
||||||
|
return ""+valeur1+"\n"+valeur2;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void main(String[] args){
|
||||||
|
EXO1 test = new EXO1();
|
||||||
|
System.out.println(test.toString());
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user