I can't access my images!!!
Greetings
First I thought it might be an error in my code but upon executing the following code that calculates the images's height and width it returns -1 values? the test.jpg exists in the same folder as the ImageXY.java file and it's size is 100 * 100, I tried creating many other images, but the same problem persists. i'm using IDE3.6 with jdk1.4.2_05, although i coded it using dos prompt too.
[code:]
import java.awt.*;
import javax.swing.*;
public class ImageXY
{
public static void main(String[] args)
{
Image image = Toolkit.getDefaultToolkit().getImage("test.jpg");
ImageIcon icon = new ImageIcon(image);
int height = icon.getIconHeight();
int width = icon.getIconWidth();
System.out.println("height"+height);
System.out.println("width"+width);
}
}
[/code]
It's a really strange problem, I know there's something wrong with my java , can any body help?

