previously I haven't been specific enough in my questions, so i'll try to to as best as I can. I'm really new at java, so forgive me if I don't understand basic concepts.
I've been following a tutorial about making a basic java game from Zetcode, and i'm stuck on the movingsprites section. I'm pretty sure my code is correct, but I can't get the "sprite.png" image to appear when I run the program. All I get is a completely black window. I've searched around, and apparently other people had the same problem, but have been unable to resolve it. Perhaps some of you could lead me in the right direction? Here is my code:
public class Craft {
private int dx;
private int dy;
private int x;
private int y;
private Image image;
public Craft() {
initCraft();
}
private void initCraft() {
ImageIcon ii = new
ImageIcon("craft.png");
image = ii.getImage();
x = 40;
y = 60;
}
I placed the file "craft.png" in /zetcode/src/image. I also tried leaving the image in /zetcode, but the same thing still happened.
Thank you in advance!