Test
This commit is contained in:
parent
4044ba1bcd
commit
c367c35d94
21
BUT1/DEV2.1/TD/Td.java
Normal file
21
BUT1/DEV2.1/TD/Td.java
Normal file
@ -0,0 +1,21 @@
|
||||
public interface FileFilter{
|
||||
boolean accept(File f);
|
||||
}
|
||||
|
||||
|
||||
public class DirectoryFilter implements FileFilter{
|
||||
@Override
|
||||
public boolean accept(File f){
|
||||
return f.isDirectory();
|
||||
}
|
||||
}
|
||||
|
||||
public class Exemple{
|
||||
public static void main(String[] args){
|
||||
File home = new File(System.getProperty("user.home"));
|
||||
File[] liste = home.listFiles(new DirectoryFilter());
|
||||
for(File f : liste){
|
||||
System.out.println(f);
|
||||
}
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@ public class exo4 {
|
||||
JFrame fenetre = new JFrame();
|
||||
|
||||
// on configure la fenetre
|
||||
fenetre.setSize(1200, 1000);
|
||||
fenetre.setPreferredSize(1200, 1000);
|
||||
fenetre.setLocation(100, 100);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
|
@ -15,4 +15,5 @@ public class compteur {
|
||||
return Integer.toBinaryString(this.compte);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1,9 +0,0 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Gris extends Color {
|
||||
// Constructeurs
|
||||
public Gris(int a){
|
||||
super(a,a,a);
|
||||
}
|
||||
}
|
BIN
BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class
Normal file
BIN
BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class
Normal file
Binary file not shown.
28
BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java
Normal file
28
BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java
Normal file
@ -0,0 +1,28 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Gris extends Color {
|
||||
// Constructeurs
|
||||
public Gris(int a){
|
||||
super(a,a,a);
|
||||
}
|
||||
|
||||
public static void main(String args[]){
|
||||
// Création d'une fenêtre + configuration
|
||||
JFrame fenetre = new JFrame();
|
||||
fenetre.setSize(500, 500);
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
// Création d'une variable de type couleur avec les données d'un gris
|
||||
Color couleur = new Gris(120);
|
||||
|
||||
// Création d'un panneau + ajout de la couleur de fond gris
|
||||
JPanel panneau = new JPanel();
|
||||
panneau.setBackground(couleur);
|
||||
// Ajout du panneau à la fenêtre
|
||||
fenetre.add(panneau);
|
||||
|
||||
// Affichage de la fenêtre
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
16
BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java
Normal file
16
BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java
Normal file
@ -0,0 +1,16 @@
|
||||
public class PaperEnCm extends Paper {
|
||||
|
||||
// Attributs
|
||||
private double Width_A4 = 8.27;
|
||||
private double Height_A4 = 11.69;
|
||||
private double Margin = 0.590551; // 1.5 cm to inches
|
||||
|
||||
// Constructeur
|
||||
public PaperEnCm() {
|
||||
Paper papier = new Paper();
|
||||
setSize(Width_A4, Height_A4);
|
||||
setImageableArea(Margin, Margin,Width_A4,Height_A4);
|
||||
}
|
||||
|
||||
public double getMetric()
|
||||
}
|
BIN
BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class
Normal file
BIN
BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class
Normal file
Binary file not shown.
20
BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.java
Normal file
20
BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.java
Normal file
@ -0,0 +1,20 @@
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
|
||||
public class Nuancier{
|
||||
public static void main(String args[]){
|
||||
JFrame fenetre = new JFrame("Nuancier");
|
||||
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
|
||||
|
||||
JPanel panneau = new JPanel();
|
||||
for(String element : args){
|
||||
System.out.println(element.decode());
|
||||
}
|
||||
fenetre.add(panneau);
|
||||
|
||||
|
||||
fenetre.pack();
|
||||
fenetre.setVisible(true);
|
||||
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user