Everytime I put my Game I'm making into a jar every single Image loads except for the map, I know it's in the correct case and everything it just won't load, someone take a look at my code and tell me what I'm doing wrong in this?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| import java.awt.Graphics; import java.awt.Image; import java.awt.Toolkit;
public class map {
Image map; String mp; public static int x = 0; public static int y = 0; public map(String mp) { this.mp = mp; map = Toolkit.getDefaultToolkit().getImage(this.getClass().getResource(mp)); } public void paint(Graphics g) { g.drawImage(map, x, y, null); } } |
then I make a new Object with it
1
| public static map map = new map("images/Map2.png"); |
then later...
What do I have to do to make it paint?? I've looked all around the web and the question never gets answered