5 public static void main(String[] args) {
6 // Création de la fenêtre
7 DrawingWindow w = new DrawingWindow("Exemple 2", 640, 480);
9 int width = Math.min(w.width - 1, w.height - 1) / 2;
11 // Affichage de rectangles concentriques, avec un dégradé de
13 for (int z = 0; z <= width; z++) {
15 float s = 3.0f * z / width;
16 if (z <= width / 3.0f) {
20 } else if (z <= 2.0f * width / 3.0f) {
31 // On change la couleur de dessin...
33 // ... et on affiche un rectangle
34 w.drawRect(z, z, w.width - 1 - z, w.height - 1 - z);