Java 不会显示或查找图像

Java 不会显示或查找图像,java,eclipse,image,path,Java,Eclipse,Image,Path,例如: File imageCheck = new File("picture.gif"); if(imageCheck.exists()) System.out.println("Image file found!"); else System.out.println("Image file not found!"); 图像位于源目录中,它不会显示在按钮或标签上。我在Eclipse中工作。它应该在项目目录中,而不是源目录中

例如:

File imageCheck = new File("picture.gif");
    if(imageCheck.exists()) 
        System.out.println("Image file found!");
    else 
        System.out.println("Image file not found!");

图像位于源目录中,它不会显示在按钮或标签上。我在Eclipse中工作。

它应该在项目目录中,而不是源目录中