Re: png problem continued
a) That is not the full stack trace b) Please use the code tags c) As I mentioned in another post of yours, do something with exceptions, don't just catch them and then ignore them. At the very least print out the stack trace
Code :
try
{
url=this.getClass().getResource(filename);
}
catch(NullPointerException e)
{
e.printStackTrace();
}
And last but not least - this topic already exists. Why did you start a new one with the same question? Please read the forum rules.
Re: png problem continued
i started a new one because i didnt have the errors on there and i wanted people to see the code and the errors. The code is written out of a book and should work perfectly fine it is word for word. And i dont think the book was published with errors. thats why im confused why it doesnt work. As for the exceptions I do catch them and do something with them but in this case it wasnt necessary because i was copying it from the book Java SE 6 Game Programming. I appreciate the help but can you give me an answer that i can help me figure it out?
Re: png problem continued
I tried the stackTrace() the errors that i have up in the code are the only thing the IDE shows me as errors
Re: png problem continued
My money is on castle.png not existing. Check the location and exact name of the file to make sure it is correct. If all else fails, try using the absolute path of the file.
Re: png problem continued
thanks man thats what i think too