5 static final Random random = new Random();
7 public static void main(String[] args) {
8 // Création de la fenêtre
9 DrawingWindow w = new DrawingWindow("Exemple 3", 640, 480);
11 // Sans s'arrêter, affiche des lignes au hasard avec une
12 // couleur tirée aléatoirement
14 int x1 = random.nextInt(w.width);
15 int y1 = random.nextInt(w.height);
16 int x2 = random.nextInt(w.width);
17 int y2 = random.nextInt(w.height);
18 w.setColor(random.nextFloat(),
21 w.drawLine(x1, y1, x2, y2);