The relative position of the FXML & image file must be identical at runtime & at edit time.
Check that both your FXML and your image have been copied in the build/ directory - or are present in your jar file - and that their relative position (in jar or build/) is the same than in the source folder.
hope this helps,
The build folder does not have the image files. I am running it from the NetBeans 7.1 Project. Should I manually copy the images over to /build?
In general, where should the resources be stored?
Edited by: likejiujitsu on Jan 10, 2013 11:55 AM
You can create one if needed:
In NetBeans, open the project's properties, select the Sources category, click Add Folder... and create a new folder named res or resources. Give a description like "+Resources Packages+". At compilation time, its content will be handled like the content of the src folder: resources will be copied into the build folder. You just need to be careful to have the same package/folder structure in both src and res so resources can be accessed from the code without change.
This way you can fully separate your .java files from your resources files.
Do the same with different folder names if you want to separate images from video from sound from properties files, etc.