Skip to content
Snippets Groups Projects
Commit 1905430e authored by Louis MALTERRE's avatar Louis MALTERRE
Browse files
parents 68019a10 ce57fcc8
No related branches found
No related tags found
No related merge requests found
package loaders;
import map.Coffre;
import javax.swing.*;
import java.awt.*;
import java.net.URL;
public class CoffreLoader {
private Image imageCoffre;
private Coffre coffre;
public Image getImageCoffre() {
return imageCoffre;
}
public Coffre getCoffre() {
return coffre;
}
public CoffreLoader(Coffre obs, String nom){
String fn = "Coffre/";
URL url = CoffreLoader.class.getClassLoader().getResource(fn);
assert url != null;
String path = url.toString().substring(6)+"/"+nom;
coffre = obs;
imageCoffre = new ImageIcon(path).getImage();
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment