From 019490095649a15c36d8603b1d1609dad8f2e008 Mon Sep 17 00:00:00 2001
From: Sami Zouari <sami.zouari@univ-lorraine.fr>
Date: Thu, 27 Jan 2022 16:33:22 +0100
Subject: [PATCH] =?UTF-8?q?question=2010=20finie=20jeu=20relook=C3=A9=20av?=
 =?UTF-8?q?ec=20TilePane?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 .../com/example/testig/HelloApplication.java  | 19 +++++++++++--------
 1 file changed, 11 insertions(+), 8 deletions(-)

diff --git a/src/main/java/com/example/testig/HelloApplication.java b/src/main/java/com/example/testig/HelloApplication.java
index 62f9f75..bebb432 100644
--- a/src/main/java/com/example/testig/HelloApplication.java
+++ b/src/main/java/com/example/testig/HelloApplication.java
@@ -3,6 +3,7 @@ package com.example.testig;
 import javafx.application.Application;
 import javafx.event.EventHandler;
 import javafx.fxml.FXMLLoader;
+import javafx.geometry.Insets;
 import javafx.scene.Scene;
 import javafx.scene.control.Button;
 import javafx.scene.control.Label;
@@ -11,6 +12,7 @@ import javafx.scene.image.ImageView;
 import javafx.scene.input.MouseEvent;
 import javafx.scene.layout.BorderPane;
 import javafx.scene.layout.HBox;
+import javafx.scene.layout.TilePane;
 import javafx.stage.Stage;
 
 import java.io.IOException;
@@ -28,6 +30,7 @@ public class HelloApplication extends Application {
 
         HBox box1 = new HBox();
         HBox box2 = new HBox();
+        TilePane pane = new TilePane();
 
         Image de_face1 = new Image(getClass().getResourceAsStream("/de_face1.png"), 60, 60, true, true);
         Image de_face10 = new Image(getClass().getResourceAsStream("/de_face1.png"), 60, 60, true, true);
@@ -42,17 +45,17 @@ public class HelloApplication extends Application {
         Label l3 = new Label("", de1_3);
         Label l4 = new Label("Nombre de fois ou 421 est apparu : 0      Nombre de coups joués : 0");
 
-        box1.getChildren().addAll(l1, l2, l3);
-        box2.getChildren().addAll(l4);
-
-        border.setCenter(box1);
-        border.setBottom(boutonJouer);
-        border.setTop(box2);
-        border.setLeft(boutonQuitter);
+        pane.setHgap(30);
+        pane.setVgap(40);
+        pane.setPadding(new Insets(40, 40, 40, 40));
 
         boutonJouer.setOnAction(new Ecouteur(l1,l2,l3, l4));
         boutonQuitter.setOnAction(new Ecouteur2());
 
+        pane.getChildren().addAll(l1, l2, l3, l4);
+        pane.getChildren().add(boutonJouer);
+        pane.getChildren().add(boutonQuitter);
+
         //Question 7 et 8
 
         Image exit;
@@ -60,7 +63,7 @@ public class HelloApplication extends Application {
         ImageView iconExit = new ImageView(exit);
         boutonQuitter.setGraphic(iconExit);
 
-        Scene scene = new Scene(border, 400, 400);
+        Scene scene = new Scene(pane, 450, 650);
         stage.setScene(scene);
         stage.show();
     }
-- 
GitLab