Ajout de TP
This commit is contained in:
parent
113583b37a
commit
e14dd54ef0
BIN
BUT1/.DS_Store
vendored
Normal file
BIN
BUT1/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
BUT1/DEV2.2/.DS_Store
vendored
Normal file
BIN
BUT1/DEV2.2/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
BUT1/DEV2.2/TP2-ComposantsGraphique/.DS_Store
vendored
Normal file
BIN
BUT1/DEV2.2/TP2-ComposantsGraphique/.DS_Store
vendored
Normal file
Binary file not shown.
BIN
BUT1/DEV2.2/TP2-ComposantsGraphique/EXO1/exo1.class
Normal file
BIN
BUT1/DEV2.2/TP2-ComposantsGraphique/EXO1/exo1.class
Normal file
Binary file not shown.
22
BUT1/DEV2.2/TP2-ComposantsGraphique/EXO1/exo1.java
Normal file
22
BUT1/DEV2.2/TP2-ComposantsGraphique/EXO1/exo1.java
Normal file
@ -0,0 +1,22 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class exo1 {
|
||||
public static void main(String[] args) {
|
||||
// un objet pour servir de fenetre
|
||||
JFrame fenetre = new JFrame();
|
||||
// on configure la fenetre
|
||||
fenetre.setSize(500, 300); /*500px x 300px*/
|
||||
fenetre.setLocation(0, 0); /*position en haut à gauche*/
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
// un composant pour afficher du texte
|
||||
JLabel etiquette = new JLabel("Sirocco");
|
||||
// on configure l'etiquette
|
||||
etiquette.setHorizontalAlignment(JLabel.RIGHT);
|
||||
etiquette.setVerticalAlignment(JLabel.BOTTOM);
|
||||
// on ajoute le composant dans la fenetre, au milieu
|
||||
fenetre.add(etiquette, BorderLayout.CENTER);
|
||||
// et on montre le resultat
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
BIN
BUT1/DEV2.2/TP2-ComposantsGraphique/EXO2/exo2.class
Normal file
BIN
BUT1/DEV2.2/TP2-ComposantsGraphique/EXO2/exo2.class
Normal file
Binary file not shown.
30
BUT1/DEV2.2/TP2-ComposantsGraphique/EXO2/exo2.java
Normal file
30
BUT1/DEV2.2/TP2-ComposantsGraphique/EXO2/exo2.java
Normal file
@ -0,0 +1,30 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class exo2 {
|
||||
public static void main(String[] args) {
|
||||
// un objet pour servir de fenetre
|
||||
JFrame fenetre = new JFrame();
|
||||
// on configure la fenetre
|
||||
fenetre.setSize(1200, 900); /*500px x 300px*/
|
||||
fenetre.setLocation(100, 100); /*position en haut à gauche*/
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
JButton bouton1 = new JButton("Boutonnnnnnnnnnnnnnnnnnnnnnnnnnnnnn n°1");
|
||||
JButton bouton2 = new JButton("Boutonnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn n°2");
|
||||
JButton bouton3 = new JButton("Bouton n°3");
|
||||
JButton bouton4 = new JButton("Bouton n°4");
|
||||
JButton bouton5 = new JButton("Bouton n°5");
|
||||
/*Les boutons s'adaptent en fonction de leurs positions sur la fenêtre.
|
||||
Quand on redimensionne la fenêtre, les boutons rapticissent en mode responsif css*/
|
||||
|
||||
fenetre.add(bouton1, BorderLayout.NORTH);
|
||||
fenetre.add(bouton2, BorderLayout.WEST);
|
||||
fenetre.add(bouton3, BorderLayout.SOUTH);
|
||||
fenetre.add(bouton4, BorderLayout.EAST);
|
||||
fenetre.add(bouton5, BorderLayout.CENTER);
|
||||
|
||||
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
BIN
BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.class
Normal file
BIN
BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.class
Normal file
Binary file not shown.
35
BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.java
Normal file
35
BUT1/DEV2.2/TP3-MiseEnPage/EXO1/exo1.java
Normal file
@ -0,0 +1,35 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class exo1 {
|
||||
public static void main(String[] args) {
|
||||
// un objet pour servir de fenetre
|
||||
JFrame fenetre = new JFrame();
|
||||
|
||||
// on configure la fenetre
|
||||
fenetre.setSize(1200, 1000);
|
||||
fenetre.setLocation(100, 100);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
// On crée une zone de texte
|
||||
JRadioButton boutonRadio1 = new JRadioButton("Gryffondor");
|
||||
JRadioButton boutonRadio2 = new JRadioButton("Serdaigle");
|
||||
JRadioButton boutonRadio3 = new JRadioButton("Serpentard");
|
||||
JRadioButton boutonRadio4 = new JRadioButton("Poufsouffle");
|
||||
|
||||
ButtonGroup Groupe = new ButtonGroup();
|
||||
Groupe.add(boutonRadio1);
|
||||
Groupe.add(boutonRadio2);
|
||||
Groupe.add(boutonRadio3);
|
||||
Groupe.add(boutonRadio4);
|
||||
|
||||
// on ajoute le composant dans la fenetre, au milieu
|
||||
fenetre.add(boutonRadio1,BorderLayout.NORTH);
|
||||
fenetre.add(boutonRadio2,BorderLayout.CENTER);
|
||||
fenetre.add(boutonRadio3,BorderLayout.SOUTH);
|
||||
fenetre.add(boutonRadio4,BorderLayout.SOUTH);
|
||||
|
||||
// et on montre le resultat
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user