Results 1 to 4 of 4
  1. #1
    kez323 is offline Member
    Join Date
    May 2012
    Posts
    8
    Rep Power
    0

    Default Netbeans buildpath images?

    Hey, so in Java, to display an image I do:
    Java Code:
    ImageIcon playerimg = new ImageIcon("/Users/kezhall/Desktop/player.png");
            
    player = playerimg.getImage();
    
    g.drawImage(player, x, y, this);
    But this clearly wont work on other peoples computers cause the ImageIcon path will be different. Ive tried making a folder within my package called images and setting it to:
    Java Code:
    ImageIcon("images/player.png");
    but that dont work either.

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,229
    Rep Power
    19

    Default Re: Netbeans buildpath images?

    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  3. #3
    gimbal2 is offline Just a guy
    Join Date
    Jun 2013
    Location
    Netherlands
    Posts
    3,972
    Rep Power
    5

    Default Re: Netbeans buildpath images?

    There is an even shorter one that fits the bill!

    Retrieving Resources (The Java™ Tutorials > Deployment > Java Web Start)

    edit: hm, now I see it is in the webstart section. But it still applies 100%.
    "Syntactic sugar causes cancer of the semicolon." -- Alan Perlis

  4. #4
    kez323 is offline Member
    Join Date
    May 2012
    Posts
    8
    Rep Power
    0

    Default Re: Netbeans buildpath images?

    Thanks!
    Last edited by kez323; 08-04-2013 at 08:08 PM.

Similar Threads

  1. Replies: 14
    Last Post: 02-05-2013, 09:38 AM
  2. Replies: 0
    Last Post: 11-14-2012, 11:15 AM
  3. Replies: 4
    Last Post: 12-16-2010, 04:32 PM
  4. NetBeans to set images for J2ME
    By oluwaphemi in forum CLDC and MIDP
    Replies: 0
    Last Post: 07-09-2010, 08:12 PM
  5. images not displayed by netbeans
    By R_Upadhyay in forum NetBeans
    Replies: 1
    Last Post: 02-11-2010, 08:04 AM

Tags for this Thread

Posting Permissions

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