I'm having tough time with netbeans. I am trying to add external image files to the netbeans project but confused where to place them. I copied the image files in every folder of netbeans(as i was tired) but nothing worked.
Where exactly I should place the external resource files(images,videos,auidos etc)..
5 Months Ago
Related Article:Check If JAR Exists Before Importing It
is a Java discussion thread by RLS0812_1 that has 3 replies, was last updated 5 months ago and has been tagged with the keywords: java, jar, import, include.
you sound like you have problems accessing the files no matter where you place them, and not with where exactely to put them. I do not know about netbeans... but if you are having difficulties with accessing your files, first thing that comes to mind is that you have paths hard coded and that inside quotes, your backsalsh are very likely not correctly typed in.... they should be doubled... example:
"c:\mycomp\myfolder\myfile...." <-- see, double slashes :)
you sound like you have problems accessing the files no matter where you place them, and not with where exactely to put them. I do not know about netbeans...
haha..No..My application displays the images perfectly when i try in other editor.(Editplus). The problem occurs only when i try it in netbeans.
The path is correct and i do know about that double slash. My question is where exactly i should place the external resource files(images,media files etc) in netbeans project folder?
if they are external, they can be placed: "external".
do remember that your java code is not dependant of the IDE you use, so if it works in eclipse (or editplus), it'll (should) work in netbeans as well.
but the path to the images might differ, since it's not the java files, but the .class files that need them, and not all the ide's put these in the same place(s) on your harddrive.
and not all the ide's put these in the same place(s) on your harddrive.
Yeah...that was the main problem.. These IDE's really sucks and gets worse for every version they release. Instead of understanding & using different IDE's , we can actually learn a new programming language in that time...
Anyways , my problem got solved..thanks for all replies....The solution was that i need to load the images using url and getStream() method.