Compare commits
3 Commits
016441867c
...
8773a2093d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8773a2093d | ||
|
|
19e02c8747 | ||
|
|
c92acbe2e7 |
10
DEV.3.2/TP/TP3-Listes/1.Luminance/Dessin.java
Normal file
10
DEV.3.2/TP/TP3-Listes/1.Luminance/Dessin.java
Normal file
@@ -0,0 +1,10 @@
|
||||
public class Dessin extends JPanel {
|
||||
public Dessin() {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void paintComponent(Graphics g) {
|
||||
|
||||
}
|
||||
}
|
||||
23
DEV.3.2/TP/TP3-Listes/1.Luminance/Fenetre.java
Normal file
23
DEV.3.2/TP/TP3-Listes/1.Luminance/Fenetre.java
Normal 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);
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class Luminance {
|
||||
|
||||
private ArrayList<Color> couleurs;
|
||||
private List listeDePolygones;
|
||||
|
||||
public Luminance() {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
Fenetre fenetre = new Fenetre();
|
||||
fenetre.setVisible(true);
|
||||
}
|
||||
}
|
||||
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user