Here how I solved this issue:

The key was reading over the GWT doc on organizing projects:
http://code.google.com/webtoolkit/doc/latest/DevGuideOrganizingProjects.html

--------------------- This is the relevant section
------------------------------
<public path="path" /> : Each occurrence of the <public> tag adds a
package to the public path by combining the package in which the
module XML is found with the specified path to identify the root of a
public path entry. Any file appearing in this package or any of its
subpackages will be treated as a publicly-accessible resource. The
<public> element supports pattern-based filtering to allow fine-
grained control over which resources get copied into the output
directory during a GWT compile.
If no <public> element is defined in a module XML file, the public
subpackage is implicitly added to the public path as if <public
path="public"> had been found in the XML. This default helps keep
module XML compact for standard project layouts.
---------------------------------------------------------------------------------

So I had named my package boldinventions

In Eclipse, I right-clicked on the boldinventions package and created
a subfolder and named it 'public'.
Then I right-clicked on that folder and imported the image I wanted to
use.

And now when I run it, imageLoader can find my image!


-Kevin


On Aug 9, 5:14 am, kstokes <[email protected]> wrote:
>   I'm using Eclipse on Windows.
>
>   I have added a GWTCanvas to the demo app and am trying to load an
> image and display it with code which is
> omething like this:
>
> http://code.google.com/p/google-web-toolkit-incubator/wiki/ImageLoader
>
> My problem is that the image only loads and displays if I have a
> complete URL like
>
> //                  String[] imageUrls = new String[] 
> {"http://www.knivesplus.com/
> media/SC-104OT.jpg"};  /* This works fine */
>                     String[] imageUrls = new String[] 
> {"images/GoogleCode.png"};  /*
> This does not work. */
>
> However, I have created an 'images' folder in my  war folder in
> Eclipse, and the following image in the HTML displays just fine:
>    <img src="images/GoogleCode.png"><img>
>
>   I don't understand why the app has no problem reading the image from
> the relative path when displaying the HTML, but cannot find the image
> using the ImageLoader class.
>
>   What can I do so that I can add images to my eclipse project which I
> can then use with GWTCanvas?

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to