I don't know what to do... I've been trying for weeks to figure out the problem. You see, I'm supposed to make a game, as a project for school. Since it's going to be a rather large game, I decided not to flood the main file with a bunch of images and such. Instead, I tried to put the images in another program, as I've learned that the "main" program can call upon the smaller ones.
But... It won't read the image! If I copy the code to the main file then it works perfectly, so why does it make such a fuss when put into another file? I don't know where to turn, please help me even if it's something stupidly easy...
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class Panels
{
static void floorpanel1(int x, int y, Graphics g)
{
Image fp1 = Toolkit.getDefaultToolkit().getImage("graphics/Scrapfloor1.gif");
Rectangle hitground = new Rectangle(x, y, 60, 1);
g.drawImage(fp1,x,y, 60, 60,this);
}
}
This is the code for the side-program. I'm still learning as I go along... It's called upon to be in the "paint" part of the main program.