feat(graphique): ajout images, fix tailles gridpane

This commit is contained in:
bouclyma 2024-12-05 10:50:48 +01:00
parent 6d8ec5b7f5
commit bf1099609c
5 changed files with 25 additions and 15 deletions

View file

@ -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();
}

View file

@ -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);
}
}