Compare commits

...

3 Commits

Author SHA1 Message Date
EmmanuelTiamzon
8773a2093d update 2025-12-05 11:15:44 +01:00
EmmanuelTiamzon
19e02c8747 Ajout fenetre 2025-12-05 10:52:51 +01:00
EmmanuelTiamzon
c92acbe2e7 update 2025-12-05 10:52:29 +01:00
5 changed files with 51 additions and 1 deletions

View File

@@ -0,0 +1,10 @@
public class Dessin extends JPanel {
public Dessin() {
}
@Override
public void paintComponent(Graphics g) {
}
}

View File

@@ -0,0 +1,23 @@
import java.awt.*;
import javax.swing.*;
public class Fenetre extends JFrame {
public Fenetre() {
super("Luminance");
this.setSize(300, 100);
this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
this.setLocationRelativeTo(null);
this.setLayout(new GridBagLayout());
this.setBackgrund(Color.WHITE);
GridBagConstraints contraintes = new GridBagConstraints();
contraintes.gridx = 1;
contraintes.gridy = 1;
this.setVisible(true);
}
}

View File

@@ -0,0 +1,11 @@
import java.util.ArrayList;
public class Luminance {
private ArrayList<Color> couleurs;
private List listeDePolygones;
public Luminance() {
}
}

View File

@@ -0,0 +1,6 @@
public class Main {
public static void main(String[] args) {
Fenetre fenetre = new Fenetre();
fenetre.setVisible(true);
}
}

View File

@@ -15,7 +15,7 @@ Mini conclusion : les listes c'est mauvais on sait pas ce que ça donne et gén
L'interface [Collection](https://docs.oracle.com/javase/8/docs/api/java/util/Collection.html) représente les collections en général. Elle hérite de l'interface [Iterable](https://docs.oracle.com/javase/8/docs/api/java/lang/Iterable.html), ce qui la rend compatible avec les boucles énumératives. L'interface [List](https://docs.oracle.com/javase/8/docs/api/java/util/List.html) hérite de Collection et représente une liste.
Il y a aussi [Iterator](https://docs.oracle.com/javase/8/docs/api/java/util/Iterator.html) avec ses méthode :
* boolean hasNext : Returns `true` if the iteration has more elements.
* [E](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "type parameter in List")[remove](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#remove-int-)(int index) Removes the element at the specified position in this list (optional operation).
* [E](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "type parameter in List") [remove](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#remove-int-)(int index) Removes the element at the specified position in this list (optional operation).
* [add](https://docs.oracle.com/javase/8/docs/api/java/util/List.html#add-int-E-)(int index, [E](https://docs.oracle.com/javase/8/docs/api/java/util/List.html "type parameter in List") element)Inserts the specified element at the specified position in this list (optional operation).
Parmi les classes qui réalisent List, on note [ArrayList](https://docs.oracle.com/javase/8/docs/api/java/util/ArrayList.html) et [LinkedList](https://docs.oracle.com/javase/8/docs/api/java/util/LinkedList.html)