This may have been asked a lot but for some reason, my getResource method could not find the file in my resource folder. The file is in programfolder/resources/images/drag.png
. My getResource code is:
SidebarItem.bufferedImage = ImageIO.read(Main.class.getResource("/images/drag.png"));
my classpath is:
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="resources"/>
Whenever I run the main class it always throw an exception because it could find the drag.png
file. Thanks