示例:
File imageCheck = new File("picture.gif");
if(imageCheck.exists())
System.out.println("Image file found!");
else
System.out.println("Image file not found!");
图像位于源目录中,不会在按钮或标签上显示。我正在 Eclipse 中工作。
最佳答案
它应该位于项目目录中,而不是源目录中。
关于java - 不会显示或查找图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6127538/