How do I make ImageIcon strings shorter.
This is probably a very simple answer, but in all my googling and searching I can't find it.
My problem is this: Whenever I create an ImageIcon, I have to type a very long string starting at my hard drive.
This is very long and tedious, and would not work on a different computer without the exact path. I am hoping someone could explain to me how to use shorter strings like this:
ImageIcon myIcon = new ImageIcon("C:/Documents and Settings/ExampleUser/eclipse/workspace/Project/src/Mypackage/Icon.PNG")
Please help me!!!
ImageIcon myIcon = new ImageIcon("/MyPackage/Icon.PNG")
Hopefully the code is correct, had to write it as I created this post.:eek: