Un peu de ménage dans le git

This commit is contained in:
2024-12-02 20:51:28 +01:00
parent 0e6450f8c8
commit 9b2a314262
102 changed files with 49818 additions and 27 deletions

View File

@@ -0,0 +1,35 @@
package fr.monkhanny.dorfromantik.utils;
import java.awt.Image;
import java.io.File;
import java.io.IOException;
import javax.imageio.ImageIO;
/**
* Classe utilitaire pour charger des images à partir de fichiers.
*
* @version 1.0
* @author Moncef STITI
*/
public class ImageLoader {
/**
* Icône de l'application.
*/
public static final Image APPLICATION_ICON = ImageLoader.loadImage("./ressources/images/Application/Application_Icon.jpg");
/**
* Charge une image à partir du fichier spécifié.
*
* @param filePath Chemin du fichier image à charger.
* @return L'image chargée, ou null si une erreur se produit.
*/
public static Image loadImage(String filePath) {
try {
File imageFile = new File(filePath);
return ImageIO.read(imageFile);
} catch (IOException e) {
System.err.println("Erreur lors du chargement de l'image : " + e.getMessage());
return null;
}
}
}