I am have trouble loading an image with java code. I have the image, i.png in the same package as the class this code is in. This is the code.
Image img;
try
{
img = ImageIO.read(new File("i.png"));
}
catch(IOException e)
{
}
When i execute this code it throws an IOException and says it cannot read the input file.
Would anybody know why it might throw that exception
Sorry for the bad wording
what i ment is the code throws an exception then you obviosly can'nt use it later in the code(Thats what i get for staying up till 11:30)
Thanks for the help!