两种方法一 写全路径:
try {
         File f = new File("c:\\eclipse\\workspace\\...\\src\\bull.gif");
if (f.exists()) {
Image image = ImageIO.read(f);
} else
System.out.println("not find file!!");
} catch (IOException e) {
e.printStackTrace();
}
2、写工程路径
ry {
         File f = new File("src\\bull.gif");
if (f.exists()) {
Image image = ImageIO.read(f);
} else
System.out.println("not find file!!");
} catch (IOException e) {
e.printStackTrace();
}