In my game I have the following code:
public Main() { p = new Potato(); addKeyListener(new AL()); setFocusable(true); ImageIcon i = new ImageIcon("C:/test.png"); img = i.getImage(); time = new Timer(5, this); time.start(); en = new Enemy(700, 200, "C:/enemy.png"); en2 = new Enemy(700, 200, "C:/enemy.png"); }
However I would like to put test.png inside of the package, but when I do it creates errors with the i piece. I want to put the images inside of a folder inside the jar file, but then what would I put in there place? I'm mainly asking how do I make ImageIcons reference files inside of the jar.