I've created actor classes to serve as texts on my game. Whenever I set their images by right clicking them and adding them into the world, they only display as the greenfoot icons. The images are in the images folder and are in .png format. I also tried setting the images through code using these lines:
but the following error shows:
import greenfoot.*; public class controls extends Actor { public void act() { setImage("instruc.png"); } }
java.lang.IllegalArgumentException: Could not load image from: instruc.png
at greenfoot.GreenfootImage.loadURL(GreenfootImage.java:277)
at greenfoot.GreenfootImage.loadFile(GreenfootImage.java:302)
at greenfoot.GreenfootImage.<init>(GreenfootImage.java:108)
at greenfoot.Actor.setImage(Actor.java:439)
at controls.act(controls.java:18)
at greenfoot.core.Simulation.actActor(Simulation.java:567)
at greenfoot.core.Simulation.runOneLoop(Simulation.java:530)
at greenfoot.core.Simulation.runContent(Simulation.java:193)
at greenfoot.core.Simulation.run(Simulation.java:183)