• Post Reply Bookmark Topic Watch Topic
  • New Topic

relative path of image

 
Ashik Uzzaman
Ranch Hand
Posts: 2373
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi guys,
I want to load an image that's drawn in a canvas and stored in a folder of HDD. If i give absolute path of the HDD like "e:\spectrum\images\logo.jpg" it works nice. But if i want to give relative path starting with "/" or "." it can't show the image, because my main class (class that contains main()) is in a different directory. I tried getCanonicalPath() and getAbsolutePath() also without success...
How can i use relative path in this case?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!