🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #3542

Re: Image .gif in an applet.

#3542
From: Andrew Bennett
Date: Mon, 01 Dec 1997 00:00
44 lines
2132 bytes


Fernando Ruza Rodriguez wrote:

> Hello there!!
>
> I have a problem with an applet and an image gif in it. Well, I have
> made an applet where among other things show an image logo gif and this
> is the problem.
> I can not get it work. I receive an error message from the browser. It
> said that I do not have permisions to read files in the home computer.
> But the image is not in the home computer. The image is include in the
> applet zip file that the browser download.
>
> I included the image in my proyect with JBuilder with the + button and
> type a relative path (not absolute) so I think it would have to work.
>
> I do not know. It is this kind of things that you become mad. {:-)
>
> Anyway, I will be very grateful with everybody who can help me.
> Thanks in advance and I'm looking forward to hearing some solutions to
> this stupid problem.
>

Chances are when you designed your app, you specified the place of
the image, say, e:\myimages\image.gif

So, when this applet is loaded from a web server by a web browser,
it won't let the browser access the local drive.

You may want to look at getImage().  You need to load the image
via a URL, ie http://myhost.com/images/web/image.gif, and create
an Image object.  That way, the applet will request the browser
to load the image over port 80 or whatever http port you are using,
and it will ask the web server to fetch and stream the image.


Andrew
--
  Andrew Bennett            ->  abennett@borland.com
  JBuilder info             ->  http://www.borland.com/jbuilder/
  JBuilder newsgroups info  ->  http://www.borland.com/newsgroups/
**** Please don't post a reply AND send email.  Do one.  I'll see it. ****
Technical Details
Message-ID: <34830A57.7DFAA83E@borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <347B7F4B.559349B@mx3.redestb.es>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,e962188f2e6e753a
X-Google-Attributes: gid1089d0,public
From: Andrew Bennett <abennett@borland.com>
Subject: Re: Image .gif in an applet.
Date: 1997/12/01
Message-ID: <34830A57.7DFAA83E@borland.com>
X-Deja-AN: 294277319
References: <347B7F4B.559349B@mx3.redestb.es>
Organization: None
Newsgroups: borland.public.jbuilder.java.api