diff --git a/chat/src/main/java/rtgre/chat/ChatApplication.java b/chat/src/main/java/rtgre/chat/ChatApplication.java index 70ea41f..7e436cb 100644 --- a/chat/src/main/java/rtgre/chat/ChatApplication.java +++ b/chat/src/main/java/rtgre/chat/ChatApplication.java @@ -3,10 +3,12 @@ package rtgre.chat; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Scene; +import javafx.scene.image.Image; import javafx.stage.Stage; import java.io.IOException; import java.io.InputStream; +import java.util.Objects; import java.util.logging.Level; import java.util.logging.LogManager; import java.util.logging.Logger; @@ -31,8 +33,10 @@ public class ChatApplication extends Application { FXMLLoader fxmlLoader = new FXMLLoader(ChatApplication.class.getResource("chat-view.fxml")); Scene scene = new Scene(fxmlLoader.load(), 320, 240); stage.setTitle("Chat @BOUCLY_Emi (B2GA)"); - stage.setMinWidth(800); - stage.setMinHeight(500); + + stage.getIcons().add(new Image(Objects.requireNonNull(ChatApplication.class.getResourceAsStream("rt.png")))); + stage.setMinWidth(600); + stage.setMinHeight(400); stage.setScene(scene); stage.show(); } diff --git a/chat/src/main/java/rtgre/chat/ChatController.java b/chat/src/main/java/rtgre/chat/ChatController.java index 3c4f5ba..c1552c9 100644 --- a/chat/src/main/java/rtgre/chat/ChatController.java +++ b/chat/src/main/java/rtgre/chat/ChatController.java @@ -3,9 +3,11 @@ package rtgre.chat; import javafx.fxml.FXML; import javafx.fxml.Initializable; import javafx.scene.control.*; +import javafx.scene.image.Image; import javafx.scene.image.ImageView; import java.net.URL; +import java.util.Objects; import java.util.ResourceBundle; import java.util.logging.Logger; @@ -28,5 +30,9 @@ public class ChatController implements Initializable { @Override public void initialize(URL url, ResourceBundle resourceBundle) { LOGGER.info("Initialisation de l'interface graphique"); + + Image image = new Image(Objects.requireNonNull(ChatController.class.getResourceAsStream("anonymous.png"))); + this.avatarImageView.setImage(image); + } } \ No newline at end of file diff --git a/chat/src/main/resources/rtgre/chat/anonymous.png b/chat/src/main/resources/rtgre/chat/anonymous.png new file mode 100644 index 0000000..01d5e63 Binary files /dev/null and b/chat/src/main/resources/rtgre/chat/anonymous.png differ diff --git a/chat/src/main/resources/rtgre/chat/chat-view.fxml b/chat/src/main/resources/rtgre/chat/chat-view.fxml index 1346863..33ce53e 100644 --- a/chat/src/main/resources/rtgre/chat/chat-view.fxml +++ b/chat/src/main/resources/rtgre/chat/chat-view.fxml @@ -19,7 +19,7 @@ - + @@ -36,11 +36,11 @@ - + - - - + + + @@ -48,33 +48,33 @@ - - + - + diff --git a/chat/src/main/resources/rtgre/chat/rt.png b/chat/src/main/resources/rtgre/chat/rt.png new file mode 100644 index 0000000..db84b1d Binary files /dev/null and b/chat/src/main/resources/rtgre/chat/rt.png differ