Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/image/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Image 如何在intellij IDEA中导入图像?_Image_Intellij Idea_Import - Fatal编程技术网

Image 如何在intellij IDEA中导入图像?

Image 如何在intellij IDEA中导入图像?,image,intellij-idea,import,Image,Intellij Idea,Import,使用此代码时,我在intellij IDEA中导入图像时遇到问题: Image imageVariable = getImage( getCodeBase( ), filename ); 当我运行程序时,它没有显示图像,有什么问题吗 我确信文件名是相同的和正确的 谢谢您可以将图像放在resources文件夹中,并在运行时从har获取它-请查看getClassLoader.getResourceAsStream。在哪里可以找到resources文件夹?你是说src文件夹吗

使用此代码时,我在intellij IDEA中导入图像时遇到问题:

Image  imageVariable  =  getImage( getCodeBase( ), filename );
当我运行程序时,它没有显示图像,有什么问题吗

我确信文件名是相同的和正确的


谢谢

您可以将图像放在resources文件夹中,并在运行时从har获取它-请查看getClassLoader.getResourceAsStream。在哪里可以找到resources文件夹?你是说src文件夹吗