-1

I just started a new Java Project and I'm working on Animations atm, my question now is how do I link my res source folder with the project so that I can read images via

img = ImageIO.read(getClass().getClassLoader().getResourceAsStream(name));

from that folder? Normally I they can only be read when they are in the

user263980
  • 31
  • 1
  • 6

1 Answers1

0

if we assume that your resource folder is called "resources":

Image image = Toolkit.getDefaultToolkit().createImage(yourclassName.class.getResource("/resources/..."));