It's not a secret anymore!
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes html files and images Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "html files and images" Watch "html files and images" New topic

html files and images

Aruna Raghavan
Ranch Hand

Joined: May 14, 2002
Posts: 194
Whenever I access a resource (html files and images) in my code, I use
I did not put any relative/absolute paths. But my help/user manual files are online. They are html. They include the following
<img src="welcome.jpg"/><BR>
Will I be in trouble because the app will find the html file but not the image embedded in it?
Should I play it safe and get rid of the image files for screen shots?

Aruna A. Raghavan<br />SCJP, SCJD, SCWCD
Mark Spritzler

Joined: Feb 05, 2001
Posts: 17276

I used relative paths, and used the "user.dir" property to access the HTML page, and in the main directory there was an images subdirectory that I used for the images and relative path, it worked fine.

Perfect World Programming, LLC - iOS Apps
How to Ask Questions the Smart Way FAQ
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
I packaged the whole caboodle in my jar -- yes, that included my online HTML manual and all the images used by the HTML. Works like a dream. Way to go, IMHO -- no file clutter, no dependency on locations or properties.
Remember, Java can turn jar resources into a URL (Class.getResource()/ClassLoader.getResource()) using some magic syntax with the jar pseudo-protocol. That works just fine with the Swing editor widget thingie. All I did wasHTH
- Peter
[ January 16, 2003: Message edited by: Peter den Haan ]
I agree. Here's the link:
subject: html files and images
It's not a secret anymore!