I have a GUI component which I created, and it has an icon with it. I want to package the icon with the component so that it is all together. In my class I have: new ImageIcon("icons/myIcon.gif")
I also wrote a test program to test the component.
If I run the test program from the same package that the component is in, everything works fine, but if I put the test program outside of the component's package, the icons don't show up. How can I fix this so that the icons will show up, but I do not want to hard code a path like C:\java\myStuff\gui\icons\myIcon.gif?
For some reason, the only way the icon shows up is if I run