Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to add an image into netbeans Java project

Tags:

java

netbeans

I'm doing a simple Java project on Netbeans. And I'm stuck not knowing how to add my own image into the code. It kept throwing IOException no matter where I put the image. This sounds ridiculous but it really got me stuck.

like image 720
Khoi Avatar asked Oct 11 '10 07:10

Khoi


1 Answers

If you run the program from netbeans, the root folder should be the same as the root of the project folder. That is, the folder which contains build.xml and manifest.mf.

If putting your image directly in that folder, and loading it without any path given doesn't work, then you will have too look at your code and see if you can find any errors.

like image 101
kskjon Avatar answered Sep 29 '22 13:09

kskjon