Test
This commit is contained in:
parent
77aea5b825
commit
9de7f66a8d
@ -18,4 +18,9 @@ public class Exemple{
|
|||||||
System.out.println(f);
|
System.out.println(f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Controleur extends MouseAdapter
|
||||||
|
implements MouseMotionListener, ActionListener{
|
||||||
|
...
|
||||||
}
|
}
|
@ -7,7 +7,7 @@ public class exo4 {
|
|||||||
JFrame fenetre = new JFrame();
|
JFrame fenetre = new JFrame();
|
||||||
|
|
||||||
// on configure la fenetre
|
// on configure la fenetre
|
||||||
fenetre.setPreferredSize(1200, 1000);
|
fenetre.setSize(1200, 1000);
|
||||||
fenetre.setLocation(100, 100);
|
fenetre.setLocation(100, 100);
|
||||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||||
|
|
||||||
|
BIN
BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Moto.class
Normal file
BIN
BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Moto.class
Normal file
Binary file not shown.
BIN
BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Test.class
Normal file
BIN
BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Test.class
Normal file
Binary file not shown.
BIN
BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Vehicule.class
Normal file
BIN
BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Vehicule.class
Normal file
Binary file not shown.
BIN
BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Voiture.class
Normal file
BIN
BUT1/DEV2.1/TP7-Polymorphisme/EXO1/Voiture.class
Normal file
Binary file not shown.
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$1.class
Normal file
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$1.class
Normal file
Binary file not shown.
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$2.class
Normal file
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Attente$2.class
Normal file
Binary file not shown.
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.class
Normal file
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Attente.class
Normal file
Binary file not shown.
@ -1,28 +1 @@
|
|||||||
import javax.swing.*;
|
// A faire
|
||||||
import java.awt.*;
|
|
||||||
import java.awt.event.ActionEvent;
|
|
||||||
import java.awt.event.ActionListener;
|
|
||||||
|
|
||||||
public class Fond Attente ActionListener {
|
|
||||||
static JPanel panneau;
|
|
||||||
|
|
||||||
public static void main(String[] args) {
|
|
||||||
JFrame fenetre = new JFrame("Fond");
|
|
||||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
|
||||||
fenetre.setSize(500, 500);
|
|
||||||
JPanel panneau = new JPanel();
|
|
||||||
fenetre.add(panneau);
|
|
||||||
|
|
||||||
fenetre.setVisible(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
try {
|
|
||||||
int n = Integer.parseInt(args[0]);
|
|
||||||
System.out.println("En hexadecimal" + Integer.toHexString(n));
|
|
||||||
}catch(NumberFormatException e){
|
|
||||||
System.err.println("Ceci n'est pas un" + "entier !");
|
|
||||||
} catch(ArrayIndexOutOfBoundsException e){
|
|
||||||
System.err.println("Il faut un argument :");
|
|
||||||
}
|
|
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.class
Normal file
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.class
Normal file
Binary file not shown.
26
BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.java
Normal file
26
BUT1/DEV2.1/TP8-Évènements/EXO2/Dessin.java
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class Dessin extends JComponent {
|
||||||
|
|
||||||
|
private Image imageDeCercle;
|
||||||
|
public Dessin() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
// Méthode pour dessiner sur le composant
|
||||||
|
@Override
|
||||||
|
protected void paintComponent(Graphics pinceau) {
|
||||||
|
// Obligatoire : on crée un nouveau pinceau pour pouvoir le modifier plus tard
|
||||||
|
Graphics secondPinceau = pinceau.create();
|
||||||
|
|
||||||
|
// Obligatoire : si le composant n'est pas censé être transparent
|
||||||
|
if (this.isOpaque()) {
|
||||||
|
// Obligatoire : on repeint toute la surface avec la couleur de fond
|
||||||
|
secondPinceau.setColor(this.getBackground());
|
||||||
|
secondPinceau.fillRect(0, 0, this.getWidth(), this.getHeight());
|
||||||
|
}
|
||||||
|
|
||||||
|
secondPinceau.setColor(new Color(30,255,30));
|
||||||
|
secondPinceau.fillArc(20, 95, 50, 50, 0, 360);
|
||||||
|
}
|
||||||
|
}
|
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.class
Normal file
BIN
BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.class
Normal file
Binary file not shown.
12
BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.java
Normal file
12
BUT1/DEV2.1/TP8-Évènements/EXO2/Disque.java
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
import javax.swing.*;
|
||||||
|
import java.awt.*;
|
||||||
|
|
||||||
|
public class Disque extends Dessin {
|
||||||
|
public Disque(){
|
||||||
|
// Maintenant on dessine ce que l'on veut
|
||||||
|
super();
|
||||||
|
Graphics secondPinceau = getGraphics();
|
||||||
|
secondPinceau.setColor(new Color(30,255,30));
|
||||||
|
secondPinceau.fillArc(20, 95, 50, 50, 0, 360);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user