Ajout des travaux effectuer

This commit is contained in:
2024-12-09 11:53:11 +01:00
parent 05fac8d3ae
commit c4e97e13da
558 changed files with 67900 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
import javax.swing.*;
import java.awt.*;
import java.io.*;
public class Conversion
{
public static void main(String[] args)
{
}
}

View File

@@ -0,0 +1,45 @@
import javax.swing.*;
import java.awt.*;
public class Couleur extends JComponent
{
protected void paintComponent(Graphics g)
{
Graphics secondPinceau = g.create();
secondPinceau.setColor(Color.getColor());
Polygon poly1 = new Polygon();
poly1.addPoint(0,0);
poly1.addPoint(this.getWidth(), 0);
poly1.addPoint(this.getWidth(), this.getHeight());
secondPinceau.fillPolygon(poly1);
secondPinceau.setColor(Color.getColor());
Polygon poly2 = new Polygon();
poly2.addPoint(0, 0);
poly2.addPoint(0, this.getHeight());
poly2.addPoint(this.getWidth(), this.getHeight());
secondPinceau.fillPolygon(poly2);
}
public String getColor(){
try
{
FileReader fr = new FileReader("rgb.txt");
StringReader sr = new StringReader(fr);
try
{
sr.close();
}
catch(IOException e)
{
System.out.println("Erreur de fermeture");
}
}
catch(IOException e)
{
System.out.println("Erreur d'ouverture");
}
}
public Couleur()
{
super();
}
}

View File

@@ -0,0 +1,16 @@
import javax.swing.*;
import java.awt.*;
public class TestCouleur
{
public static void main(String[] args)
{
JFrame fenetre = new JFrame();
fenetre.setSize(400, 400);
fenetre.setLocation(100, 100);
fenetre.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
Couleur coul = new Couleur();
fenetre.add(coul);
fenetre.setVisible(true);
}
}

View File

@@ -0,0 +1,2 @@
MIDNIGHTBLUE
BLANCHEDALMOND