Where do I put my image files in Eclipse? [message #696479] |
Thu, 14 July 2011 05:05 |
goldminer91g Messages: 4 Registered: July 2011 |
Junior Member |
|
|
I am a self-taught programmer, still in high school, so im a bit under educated with java, but im working on it.
I say this because I believe my problem is an easy fix, and its just something im not entirely sure on. I am making a program that uses ImageIcons. I encapped the whole process of getting the ImageIcons in a try/catch, and as far as I can tell, the Images SHOULD be loaded. But, when I run my GUI, the images are missing.
And so my question for you guys is this: where do my images need to be on my computer? They are currently here:
C:\Documents and Settings\Max\workspace\Project_One\src\Game_Images
(I run a windows XP).
I currently have my images in a folder that is with my code's files, in the src folder. Is this the correct place to put the images?
This problem is very odd to me, because like i said, I am not getting any errors from the compiler or my catch statements. Any Idea as to what might be going on?
|
|
|
|
Re: Where do I put my image files in Eclipse? [message #696742 is a reply to message #696680] |
Thu, 14 July 2011 18:35 |
goldminer91g Messages: 4 Registered: July 2011 |
Junior Member |
|
|
This forum says Java Development Tools: that to me says that this forum is about learning to use tools of the compiler: in this case, the compiler of Eclipse. For the development of my program, i need to be able to load images, which i am doing by creating ImageIcons, which use a path to find the desired images. I made a new folder in my project, put my images in there, and still, when I run my program, the spots where the images should be are empty, but there are no returned errors. Here is an example of that code:
try{
Icon Full_HP = new ImageIcon("Project_One/src/Images/Game_Images/Wood_fullHP.jpg");
}catch(Exception FileLoadException){
System.out.println("Failed to load Wood_Block ImageIcon.")
}
|
|
|
|
Powered by
FUDForum. Page generated in 0.02998 seconds