Where to put a folder with icons?

Hi,
I have created a small application that makes use of some icons (for use with some JButtons).
I have noticed when I am running application through eclipse if I write:
HomeBtn.setIcon(new ImageIcon("player/icons/house48.png"));and put the "icons" folder in the "player" folder (which is also the name of the package my main application lies) it works.
if I create a jar file with this command:
jar cvmf manifest.stub player.jar player/ common/ and send it to a friend of mine who is using windows (I am using Linux) it does not show the icons. If I want him to display the icons he has to open the jar file and create this structure in it: "player/player/icons" and put the icons in there.
Why?
Is there a way to access my icons in a "global" way? or should I put everything in one folder (icons and class files) in order to have no problem?

Create a file structure that works in your machine, then zip the entire structure up. Your friend just needs to unzip the zipfile and run the program.
A couple of points: Make sure that what you create will work on Windows; newline values, directory separator values, etc. Avoid absolute directory references.

Similar Messages

  • Where to put .txt file with SimpleInput

    Hello everyone,
    I'm rather new to Java and have a slight problem. The thing is that I need to write an app that can read a text file in this format:
    2
    Orc
    name = Gnorck
    experience = 20
    maxHealthPoints = 50
    healthPoints = 30
    maxBerserk = 9
    berserk = 7
    Human
    name = Aragorn
    experience = 45
    maxHealthPoints = 40
    healthPoints = 30
    maxGreed = 20
    greed = 10
    The first number is de number of characters in the file and after that every character is described in 7 lines.
    Now the application has to be able to read the file. I've choosen to first just make a list of characters. A friend helped me with this code but I'm not completely sure if I know how it works. The code:
    package RPGApplicatie;
    import java.util.*;
    public class Karakters {
         //Constructor
         public Karakters(int size){
              karakters = new ArrayList(size);
         //Methode voor het toevoegen van een karakter
         public void voegToe(Karakter k){
              karakters.add(k);
         public static Karakters readFile(String filename) throws ClassNotFoundException, RuntimeException, InstantiationException, IllegalAccessException{
              SimpleInput file = new SimpleInput(filename);
              int size = file.nextInt();
              Karakters result = new Karakters(size);
              for(int i = 0; i < size ; i++) {
                   Class c = Class.forName(file.nextLine());
                   result.voegToe((Karakter)c.newInstance());
              return result;
         //Variabelen aanmaken
         private ArrayList<Karakter> karakters;
    }First question: I have the classes Karakter (which is the superclass for class Human and Orc), Human and Orc. So does the method forName scan for strings that are also classes? Like so it scans the file and when it comes across a line that says either 'Orc' or 'Human' it adds it to the list?
    Second question: Where to put the text file that holds the data? I now have it in the same folder called test.txt. I use this code to run it:
    package RPGApplicatie;
    public class RPGApplicatie {
         public static void main(String[] args) throws ClassNotFoundException, RuntimeException, InstantiationException, IllegalAccessException {
              Karakters.readFile("test.txt");
    }Thanks in advance! If more info is needed I can post that.
    Regards,
    Sander

    I assume you have defined your Human and Orc classes to include fields name, experience, etc and a constructor that takes these values as parameters?
    You can remove the Class.forName() method altogether. Example:
    int count = file.readInt();
    // define variables for Karakter values (name, experience etc.)
    for (int i = 0; i < count; i++)
      String characterClass = file.readLine();
      // read common character components
      if (characterClass.equals("Human")
        // read human specific components
        karakters.add(new Human(...));
      if (characterClass.equals("Orc")
        // create Orc
    //...Cheers

  • How can I find my iCloud folder with my deleted messages? in it

    Where is the archive folder with the deleted messages in it?

    As Winston says, only if you have made a backup to icloud.  You have to perform a restore to get them back.
    http://support.apple.com/kb/HT1766?viewlocale=en_US&locale=en_US
    Go to Settings>General>Reset and tap Erase All Content and Settings.  This will erase your device.  Then you will go through the setup screens again as you did when your device was new, and when given the option, select Restore from iCloud Backup.
    This link gives another overview of backup and restore:
    http://support.apple.com/kb/HT4859?viewlocale=en_US&locale=en_US

  • I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it.

    I am trying to organize a zip file with a bunch of links and files. But when I drag an image file to a folder, it always "Snaps to grid" instead of just landing where I put it. All of the files are going into the same zip file but I want them visually in the space that I put them and not at the bottom of the snap to grid folder location they are looking like.  I am trying to  drag and drop files in groups so that I can group them for now, but image files always do their own "sort by" when I drag them from my web pages. Links don't do it though.  I tried resetting the folder, and deleting the DS files. No luck.

    You keep asking variants on this same question. You've had replies in all your other threads. If you can't find them, go here and click where it says Activity:
    Thomas Cannon Jr.

  • I renamed the folder with the little house as its icon, and now I'm screwed

    Here are the details:
    * I am running the latest update to 10.4
    * I changed the name of the folder with the little house as its icon. I changed it in the sidebar to the finder window. I changed the folder's name from it's original name to a new name, which is the name of my computer.
    * As soon as I did so, I started experiencing problems. I was using Azureus to download something (legally, of course) and I started getting popup warnings stating that the save location could not be located.
    * I then tried to open up my address book, which was now empty.
    * At this point, I became pretty sure that I messed up the...how you say...references for all my programs. In other words, my address book looks in "x" location for its addresses. My iPhoto looks in "x" location for the pictures and library files, etc.
    * I said to myself, "oh crap, look what I did" and attempted to change the folder with the little house as its icon from its current name back to the original. Unfortunately, it would not let me, and informed me that name was already in use.
    * I then said, "oh crap" and logged out of the account. I forget what my thinking was in doing this.
    * When I got to the log in screen, it gave me 4 options. There are two administrators' accounts; one I cannot access and my usual computer name. I logged into the latter, as usual.
    * When logged back in, nothing was as it should be. My desktop picture was gone, my desktop folders were gone. My dock was positioned at the bottom of the screen and was not hiding. Also, the little house went back to the original name. My program to automatically startup the Dashboard did not kick in. I clicked on iTunes and it wanted me to click through all the user' agreement set up options. When I opened up iPhoto I canceled the pop up window that was offered and found that my iPhoto library, which usually has 4000+ pictures, was empty. I opened up "Comic Life," and it asked me to register. I then looked in the finder to see if I could find a document for work. I clicked on the documents folder in the sidebar, and everything showed up. I then tried to do a search, but the files could not be located. I even visually verified the files where there, but neither spotlight or the finder search could locate them. If I clicked on a file, it opens, even though I cannot "search" for it. I've even tried to click on the actual folder and do a specific search, and receive nada.
    *I've located all of the documents/library/etc. under "Macintosh HD/users/*current name of little house icon*, but it appears as just a regular folder.
    So...there it is. I know I've screwed up my paths, but am unsure how to restore the computer to how it was. If there is no restore function, I am also unsure how to make it so my programs recognize the original library, etc.

    EDIT: Welcome to Apple Discussions. Didn't notice you just joined. In case you don't know the message I left is a "link" just click on it. Sorry to be basic but I don't your level of skills.
    Not totally
    -mj
    [email protected]

  • My MacBook Pro won't start - it just displays a grey screen with flashing icon of a folder with a question mark in the middle. Help.

    It started while I was using Adobe InDesign, and that program froze, then crashed. When I tried to reopen the program, the error message I received was simply "Error: 16".
    I tried to take a screen shot of the error message for reference, and it gave me a message saying I couldn't because I didn't have access to the files where it would normally store the shot.
    Attached to my computer at the time was my Seagate Free Agent Go-Flex for Mac backup drive.
    So, I closed any open applications, and restarted my computer. But it wouldn't restart. It only displays a grey screen with a flashing icon in the middle of a folder with a question mark on it.
    I have no idea what happened - I wasn't using the machine any differently than usual, and it only had a few basic applicaitons open in addition to InDesign (like Preview, Text Edit, Microsoft Word, iCal).
    I have MacKeeper on my MacBook, and I keep it clean.
    Does anyone out there know what this flashing icon indicates, and if there is anything I can try on my own to fix it?
    Thanks.

    ali har wrote:
    It started while I was using Adobe InDesign, and that program froze, then crashed. When I tried to reopen the program, the error message I received was simply "Error: 16".
    I tried to take a screen shot of the error message for reference, and it gave me a message saying I couldn't because I didn't have access to the files where it would normally store the shot.
    For the Error: 16
    http://kb2.adobe.com/cps/827/cpsid_82744.html
    Seems a uninstall and reinstall of CS is in order.
    Attached to my computer at the time was my Seagate Free Agent Go-Flex for Mac backup drive.
    May or may not be a contributing factor,  may have kicked in at a wrong time or running root code.
    So, I closed any open applications, and restarted my computer. But it wouldn't restart. It only displays a grey screen with a flashing icon in the middle of a folder with a question mark on it.
    Computer can't find a bootable volume.
    https://support.apple.com/kb/TS2570
    I have MacKeeper on my MacBook, and I keep it clean.
    Well that explains it, MacKeeper is almost malware.
    http://applehelpwriter.com/2011/09/21/how-to-uninstall-mackeeper-malware/
    Search the forums here for "MacKeeper" they will tell the whole story, crapware.
    Disconnect all drives, follow the "Grey Screen" instructions and hold Shift key down while booting, if you get into OS X , immediatly backup your files to another drive and disconnect.
    In my opinion you should first check to make sure you have a backup of your data, then just erase the entire internal drive (hold c boot off the 10.6 disk, use Disk Utility), reinstall OS X, same user name, update to 10.6.8, c boot off the 10.6 and Repair Disk (to fix a update error) install your programs and finally return files from backup into the same main user folders like before (Music, Docs, Pictures etc.)
    A pain it is, but you've hosed your system and in the process you might as well rebuild everything and have a fast machine again. So happens to clear MacKrapper, uninstall CS5 and any other junk in your system at the same time. Fresh, clean, lean and mean.
    Learn to Carbon Copy Cloner to a external drive that new pristine boot drive, you can hold the option key and boot from it (even update it), which is a real bacon saver when something like this happens.  Also it's free to use, donations accepted.
    http://www.bombich.com/
    Note: if anything above I've mentioned is too complicated or your not sure, seek the services of a local computer specialist.

  • Can we solve this problem -folder with the exclamation icon

    What is this folder with the exclamation icon?
    Why it happens only to the iPod connected to PC?
    Why it is the toughest problem to be solved?
    What causes it?
    Just would like to share my experience with all of you, my niece has a mini iPod that connects with a PC, however, after ejecting the iPod a few times inproperly, her iPod showed this most notorious evil icon. I followed all the instructions from the Apple web site in this forum, I did nearly ten times of Resets and Restores (I managed to restore but not everytimes), still failed to get rid of this icon, and it jsut would not disappear in the iPod. I just got very frustrated and I asked myself should I connect it with a Mac? Why not? So I connected it with my Mac, no surprise, then I put it in Disk Mode and reconnectted (few attempts), the iPod icon appeared on my Desktop but I still could not do the restore.
    As I believed that iPod was the same as an external Hard Disk, and it was broken anyway, why not have another try - so I opened the Disk Utility and saw the iPod there, then I did an Erase (format) the iPod, once completed I reconnected with my Mac again, after 4 attempts, the iPod updater window popup and asked me whether I would like to do a restore, I finally managed to get rid of this icon. I connectted it with PC and was able to do a restore in my PC and got recongzied afterward. It has happened almost for 6 months and I heard that this iPod is still working fine.
    My suggestion is - unless you need to do the update of song with your iPod, never and ever charged your iPod via connecting with the PC, I leave my iPod with the Bose docking system and it has no problem at all.

    My suggestion is - unless you need to do the update of song with your iPod, never and ever charged your iPod via connecting with the PC, I leave my iPod with the Bose docking system and it has no problem at all.
    I always use the iPod AC charger to charge my iPods and I have never had any problems.
    The initial cause of the problems in your post is probably that several improper ejection of the iPod. If you do not have a Mac the problem may not be solvable by yourself.

  • Starting Up: Folder with Question Mark Icon

    I do not know when this problem began whereas I do not restart my Mac that often. But the problem is that whenever I boot up my MacPro now I get this icon that is a folder with a question mark inside of it, and it keeps blinking.
    The weird thing is, when I insert the OS X disc and book from the HD where OS X is located, it works just fine and dandy, however, using it without the disc just stays at that folder icon screen.
    I have not done anything differently in the past few days to my computer to warrant this so I'm unsure of the problem.

    Did you go back to system preferences startup disk control panel and reset it?
    Might want to run Disk Warrior once a week as well as before and after doing a backup or restore.

  • SInce i installed Lion, my desktop icons are lining up like regimented Windows icons!  how do i get them to stay where i put them, like they used to do?  thanks! ellen

    SInce i installed Lion, my desktop icons are lining up like regimented Windows icons! 
    how do i get them to stay where i put them, like they used to do? 
    thanks!
    ellen

    In that case, there may be a problem with your Finder preferences or window settings.
    Try removing these files, then restarting:
    ~/Library/Preferences/com.apple.finder.plist
    ~/Desktop/.DS_Store
    Let me know if you're not sure how to do that.

  • Icon Folder with question mark

    Hi
    My MacBook doesn't boot anymore.
    When i start up my mac, I get an icon with a folder with a flashing question mark in it.
    I tried to re-install the OS but when it gets to the part where it asks where to install everything, my hard disk doesn't appear. It doesn't appear nether if I use Disk Utility.
    Thanks for your help

    Since the drive is not showing up, there's a good chance that it has failed. Apple has had some problems with Seagate OEM drives, and even has a replacement program. If you feel confident enough to take off the "L" bracket that covers the RAM bays and hard drive bay, you could slip the hard drive out and check to see if it's a Seagate, then contact Apple either through customer service or the genius bar at an Apple store. You could also replace the drive yourself buying a notebook HD from Macsales or Newegg.

  • Need help with folder / exclamation icon

    my ipod has the folder icon on it. when i reset it it reappeared. i left it alone to charge like the support site said. nothing. reset it and then tried to put it in disk mode and now all that is on there is the apple logo. if i reset it, it just goes back to the folder icon. please help.

    See these links:
    iPod Folder with Exclamation Point After Disconnected From Computer
    iPod Folder with Exclamation Point After Turned On
    Good Thread About iPod Sad icon/Folder with Exclamation Point
    I hope this helps!

  • Apple icon apears then folder with ! mark, then its turns of

    I was using my ipod on computer at skool, and ive had no problems, but a few days ago a computer froze up and i had to restart. i dissconected the ipod using computer but the do not dissconet did not go away. finally it did, but now when i try to turn it on, an apple icon apears followed by a folder with ! then its switches off, i cant connect it to me comp now, and it wont charge either. can any 1 help?

    Last resort- try putting it into disk mode- I was able to do this with mine and the computer was able to see it. So try to put it into disk mode http://docs.info.apple.com/article.html?artnum=93651 then restore it http://docs.info.apple.com/article.html?artnum=60983
    If this doesn't work- your hard drive may be bad and it will need to be replaced- i used ipodmods.com and they did a good job

  • How can I stop Lion tidying my desktop and putting all my icons in alphabetical order. I like my files to stay where I put them!

    How can I stop Lion tidying my desktop and putting all my icons in alphabetical order. I like my files to stay where I put them! Every morning I boot up and all my desktop items have been moved. How can I stop this?
    By the way - Lion is the worst 'upgrade' ever.

    Hello again:
    I've been to 'view' - and all I can see are the same options as before. Nothing which says the equivalent of 'stop Lion tidying my desktop alphabetically every time I boot up' - alas.
    Hmmm.  Try something:
    Trash a preference file (com.apple.finder.plist) and restart.  Then go to the view option while in Finder.  There should be a "show view options."  Select that and sort by "none."
    FWIW, I have had no discernable change in speed under OS X 10.7, but that is just my system.  I only use Adobe's free stuff.  Have you checked with Adobe to see if there are updates available?  I rarely use text edit so I have no benchmark.  I don't like the missing save as either  
    Barry
    P.S.  I am not being contrary - I just like to learn from the experiences of others. 

  • Mail Icon won't stay in the position in the dock where I put it

    I have a very strange happening on my iMac (OSX 10.5.5). The mail icon in my dock won't stay in the position where I put it. After a few seconds, it moves to the last position in the dock (before the dashed line). If my dock is at the bottom of screen, the mail icon moves to right just before the dashed line. If my dock is on the right side of screen, the mail icon moves to the bottom just before the dashed line. Each time I move the mail icon to another position in the dock, it moves back to the last position. Can anyone help me figure this out - so that I can put the mail icon where I want it to appear? Thank you. Dale

    first a question for you. are you using Mobileme? I've seen a number of posts with the same problem by people using Mobileme (which i don't have). haven't seen a resolution to this but you might want to check in the mobileme forum. If you are not using mobileme try resetting Dock preferences. delete the file homedirectory/library/preferences/com.apple.dock.plist and restart Dock by running the following terminal command
    killall Dock
    This will reset your Dock to the default and hopefully fix the issue.

  • How do I put a "close file" icon in the toolbar? I've searched for an hour to find the answer with no luck?

    How do I put a "close file" icon in the toolbar? There's an "open file" icon by default, but I cannot -- in spite of searching for an hour--find a way to put a "close file" icon in there?

    Toolbar where? What program? What system?
    Mylenium

Maybe you are looking for