Eclipse- All my image files and txt files suddenly disappear, help me find the reason
I am now using Eclipse as my IDE, and yesterday I just added some images to the bin folder in my workspace. But today when i try to open them, i find all of them just disappear, along with some txt files I previously added. The bin folder is just left with all the class files. Can anybody tell me the reason? Thanks a lot.
Re: Eclipse- All my image files and txt files suddenly disappear, help me find the re
Don't add resources to the bin folder - add them to the src folder. The bin folder is where compiled/copied files from the src folder get placed, which means the older files get deleted when a new build occurs.
Re: Eclipse- All my image files and txt files suddenly disappear, help me find the re
no, when i put the file in the src folder, i cannot form a file reader using its name. only when i put it in the bin folder can i do it. i wonder why.
Re: Eclipse- All my image files and txt files suddenly disappear, help me find the re
Quote:
Originally Posted by
jinanzhaorenbo
no, when i put the file in the src folder, i cannot form a file reader using its name. only when i put it in the bin folder can i do it. i wonder why.
Post an SSCCE. From what I gather, it sounds like you are trying to access the file directly using a FileReader...access the file as a resource - eg. by using getClass().getResource() or getClass().getResourceAsStream()