diff --git a/BUT1/DEV2.1/TD/Td.java b/BUT1/DEV2.1/TD/Td.java new file mode 100644 index 0000000..af1d874 --- /dev/null +++ b/BUT1/DEV2.1/TD/Td.java @@ -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); + } + } +} \ No newline at end of file diff --git a/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java b/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java index 7947ca6..52b7ec9 100644 --- a/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java +++ b/BUT1/DEV2.1/TP2-ComposantsGraphique/EXO4/exo4.java @@ -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); diff --git a/BUT1/DEV2.1/TP4-ClassesEtObjets/EXO1/compteur.java b/BUT1/DEV2.1/TP4-ClassesEtObjets/EXO1/compteur.java index 533c24d..e666cef 100644 --- a/BUT1/DEV2.1/TP4-ClassesEtObjets/EXO1/compteur.java +++ b/BUT1/DEV2.1/TP4-ClassesEtObjets/EXO1/compteur.java @@ -15,4 +15,5 @@ public class compteur { return Integer.toBinaryString(this.compte); } -} \ No newline at end of file +} + diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO2 b/BUT1/DEV2.1/TP5-Heritage/EXO2 deleted file mode 100644 index 90e1d11..0000000 --- a/BUT1/DEV2.1/TP5-Heritage/EXO2 +++ /dev/null @@ -1,9 +0,0 @@ -import javax.swing.*; -import java.awt.*; - -public class Gris extends Color { - // Constructeurs - public Gris(int a){ - super(a,a,a); - } -} \ No newline at end of file diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class b/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class new file mode 100644 index 0000000..a3da4aa Binary files /dev/null and b/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.class differ diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java b/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java new file mode 100644 index 0000000..5b0180b --- /dev/null +++ b/BUT1/DEV2.1/TP5-Heritage/EXO2/Gris.java @@ -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); + } +} \ No newline at end of file diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java b/BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java new file mode 100644 index 0000000..cc39a9d --- /dev/null +++ b/BUT1/DEV2.1/TP5-Heritage/EXO3/PaperEnCm.java @@ -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() +} diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class b/BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class new file mode 100644 index 0000000..56d97b1 Binary files /dev/null and b/BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.class differ diff --git a/BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.java b/BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.java new file mode 100644 index 0000000..2c7935e --- /dev/null +++ b/BUT1/DEV2.1/TP5-Heritage/EXO4/Nuancier.java @@ -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); + + } +} \ No newline at end of file