> Works for me.
> Windows 2000
> java version "1.5.0"
> Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0-b64)
> Java HotSpot(TM) Client VM (build 1.5.0-b64, mixed mode)
>>Works for me.
>>Windows 2000
[quoted text clipped - 18 lines]
> Of course, if I execute the decoding, I *never* get the icon to display so
> I'm further ahead following your suggestion ;-)
But it *did* work equally well with your URL-to-String decoding. I just
thought it was a bit long-winded, since there is the constructor which
takes a URL.
> Since I expect at least the occasional file name that includes embedded
> blanks, like "My About.gif", I think I need to search for a solution that
> works all of the time, rather than assuming the file names won't contain
> embedded blanks.
Just tried it with a file containing space chars 'duke on swing.gif': no
problem here. Printing the url shows that the spaces correctly have been
URL escaped to %20:
file:/F:/eclipse/workspace/EclipseTry/bin/images/duke%20on%20swing.gif
Maybe previous versions of Java didn't behave well with these characters.
>>The only time I don't get an icon on the 3rd dialog, is when the image
>>is not a valid gif (I created a textfile boom.txt and renamed it to
[quoted text clipped - 7 lines]
> working fine; I just have to do some more research into file formats and/or
> opening files correctly so that they can be displayed as icons.
AFAIK, bmp, gif, jpeg and png are supported. Since gif and png support
transparent pixels, they are well suited for icons. [I used duke.gif
from j2sdk1.5.0\demo\jfc\Metalworks\HelpFiles].
Of course if the image contains errors, Java cannot display it. I've see
only 1 or 2 gif images that caused Java to fail (while IrfanView could
display them).
> Thanks again for your help, Roland!
Glad I could help.
> Rhino

Signature
Regards,
Roland de Ruiter
___ ___
/__/ w_/ /__/
/ \ /_/ / \
Rhino - 07 Feb 2005 00:18 GMT
> >>Works for me.
> >>Windows 2000
[quoted text clipped - 21 lines]
> thought it was a bit long-winded, since there is the constructor which
> takes a URL.
Interesting....
I suspect the difference in our experiences is because I am reading my image
files (GIFs,JPGs) from a jar file. When there is an embedded blank in the
name of the image file (as opposed to the name of the jar file), I get
problems. If the image file name has no embedded blank, everything works
fine.
> > Since I expect at least the occasional file name that includes embedded
> > blanks, like "My About.gif", I think I need to search for a solution that
[quoted text clipped - 7 lines]
>
> Maybe previous versions of Java didn't behave well with these characters.
I think the difference is that my gifs are in a jar and yours are not.
Somehow, that causes problems in my code.
> >>The only time I don't get an icon on the 3rd dialog, is when the image
> >>is not a valid gif (I created a textfile boom.txt and renamed it to
[quoted text clipped - 8 lines]
> > opening files correctly so that they can be displayed as icons.
> AFAIK, bmp, gif, jpeg and png are supported.
I thought it was just gif, jpg, and png but NOT bmp. Mind you, I haven't
tried a bmp yet - nor a png for that matter - but I think I saw something in
the API that said gif, jpg and png were the three acceptable formats.
>Since gif and png support
> transparent pixels, they are well suited for icons. [I used duke.gif
> from j2sdk1.5.0\demo\jfc\Metalworks\HelpFiles].
> Of course if the image contains errors, Java cannot display it. I've see
> only 1 or 2 gif images that caused Java to fail (while IrfanView could
> display them).
I know that my gif images are okay because I can view them in other
contexts.
Clearly, I'm going to have to do a bit of research on proper methods of
getting and reading image files from jars that have embedded blanks in their
names.
Rhino