Results 1 to 2 of 2
  1. #1
    janpol1 is offline Member
    Join Date
    Oct 2008
    Posts
    13
    Rep Power
    0

    Default [SOLVED] Icons path

    Hi, im developing a plugin and im using some icons this way:

    private static Image UNITIMG = new Image(null,"C:\\mydir\\myicon.ico");


    Im having trouble because i dont know which path should i use so, when i package my plugin and send it to another computer, the icons will work fine.

    I have an icons folder which i include in my binary build, but i dont know the right path to access this folder. Thanks a lot for your help

  2. #2
    janpol1 is offline Member
    Join Date
    Oct 2008
    Posts
    13
    Rep Power
    0

    Default

    I`ve finally solved it this way:


    Bundle entry = Activator.getDefault().getBundle();
    URL entry1 = entry.getEntry("/icons");

    String pathIcons = FileLocator.toFileURL(entry1).getPath().substring( 1);

Similar Threads

  1. Where should this path be?
    By Abder-Rahman in forum Advanced Java
    Replies: 1
    Last Post: 02-16-2009, 07:13 AM
  2. How do I display a JList with icons and text?
    By aneesahamedaa in forum AWT / Swing
    Replies: 2
    Last Post: 09-04-2008, 08:49 AM
  3. Displaying a Button with Varying Icons
    By Java Tip in forum javax.swing
    Replies: 0
    Last Post: 06-26-2008, 07:40 PM
  4. Specify path
    By borgrodrick in forum Eclipse
    Replies: 1
    Last Post: 02-12-2008, 11:03 PM
  5. Moving icons on your desktop
    By Leprechaun in forum New To Java
    Replies: 3
    Last Post: 12-14-2007, 10:07 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •