nanode
12-13-2000, 11:33 AM
I'm using 'ant' as a build tool for a project. I'm very happy with it so far, it compiles and places classes in the correct destination. It also copies some .jpg and .gif files that I'm using for icons - however those icons are NOT visible at runtime. I'm fairly sure my build.xml is ok:
<target name="images" depends="prepare">
<copydir src="${src.dir}" dest="${lib.dir}">
<include name="**/*.gif" />
<include name="**/*.jpg" />
</copydir>
</target>
<target name="compile" depends="images" >
<javac srcdir="${src.dir}" destdir="${lib.dir}"
classpath="${lib.dir}"
debug="off" deprecation="on" optimize="on">
</javac>
</target>
It does in fact cp over the files to 'lib' before it compiles.
this is how my code is loading images:
ImageIcon radio = new ImageIcon("../images/radio.jpg");
ImageIcon check = new ImageIcon("../images/check.jpg");
Now my java class knows that it can find the images in a parallel dir. called 'images'. The compiled class has the same relative path as the source.
Any ideas why my images don't show?
<target name="images" depends="prepare">
<copydir src="${src.dir}" dest="${lib.dir}">
<include name="**/*.gif" />
<include name="**/*.jpg" />
</copydir>
</target>
<target name="compile" depends="images" >
<javac srcdir="${src.dir}" destdir="${lib.dir}"
classpath="${lib.dir}"
debug="off" deprecation="on" optimize="on">
</javac>
</target>
It does in fact cp over the files to 'lib' before it compiles.
this is how my code is loading images:
ImageIcon radio = new ImageIcon("../images/radio.jpg");
ImageIcon check = new ImageIcon("../images/check.jpg");
Now my java class knows that it can find the images in a parallel dir. called 'images'. The compiled class has the same relative path as the source.
Any ideas why my images don't show?