• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Path to Images using Xcode java project
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Path to Images using Xcode java project


  • Subject: Path to Images using Xcode java project
  • From: Michael Foster <email@hidden>
  • Date: Wed, 7 Mar 2007 15:53:02 +0000

Hi there.

When adding images, I have to use the full path to the image rather than just the image file name. The image file is in the same directory as the xcode java project and I have added it to the project. 
Example:

ImageIcon icon=new ImageIcon("mobilebg.png");
//mobilebg.png is the name of my image file i want to set as a background to my JFrame.

The above does not work when using just the file name. The image does not show.


ImageIcon icon=new ImageIcon("/Users/mfos/Documents/Uni/Java/projects/Mobile/mobilebg.png");


The above does work when I specify the full path to the image. The image shows.

Is there any way I can change this so I don't have to specify the full path?
Compiling in terminal works fine with just the filename specified.

Just starting out in Java using xcode.

Posts already on this subject have not helped me.

Many Thanks
Mike
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • viewing enum values in debugger
      • From: Micah Sharp <email@hidden>
    • Re: Path to Images using Xcode java project
      • From: Jerry <email@hidden>
  • Prev by Date: Re: [OT] Disk image creation
  • Next by Date: Re: Path to Images using Xcode java project
  • Previous by thread: Re: How to write multi-arch .asm file?
  • Next by thread: Re: Path to Images using Xcode java project
  • Index(es):
    • Date
    • Thread