0

I keep receiving an "Invalid URL: Invalid URL or resource not found" error when attempting to call this resize method from my "sprite" class. I'm not too sure as to why or how the filepath is wrong, I've tried moving the file out the resource folder and into the actual src file and even the project package and changing the file path along with it to no luck. My java package is set up as followed

>Flappybird
   >Src
      >main
      >sprite
   >resources
      >images
         >bird1

-The method from sprite being called

public void resizeImage(String filepath, int width, int height) {
        Image toReturn = new Image(filepath, width, height, false, false);
        setImage(toReturn);
    }

-It's being called in

public Bird() {
        bird = new Sprite();
        bird.resizeImage("FlappyBirds/resources/images/bird1.png", BIRD_WIDTH, BIRD_HEIGHT);
        bird.setPositionXY(locationX, locationY);
        setFlightAnimation();
    }

0 Answers0