Article View: borland.public.jbuilder.java.swing
Article #10169Re: Problem with URL
From: John P. McGrath
Date: Thu, 04 Nov 1999 00:00
Date: Thu, 04 Nov 1999 00:00
28 lines
1276 bytes
1276 bytes
On Wed, 3 Nov 1999 09:56:03 -0400, Michel PοΏ½rez wrote:
> try {
> URL myUrl = new URL(file:///c:/aplicacion/images);
> }
> catch (MalformedURLException e) {
> ...
> }
> and then
> ImagSol = new ImageIcon(url,"sol.gif");
First, I presume you did quote the argument to the URL constructor. As
is, you should get a compiler error.
I am not sure why you are getting that particular exception. But I do
see a problem in the code. The ImageIcon constructor you are using is:
public ImageIcon( URL location, String description );
URL - the URL for the image
description - a brief textual description of the image
You want to create the URL with:
URL myUrl = new URL("file:///c:/aplicacion/images/sol.gif");
--
John P. McGrath
<mcgrath@enter.net>
<jpm@nscs.fast.net>
Technical Details
Message-ID:
<MPG.128afadbdcb5c4ad98968c@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<7vpenn$c374@forums.borland.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 111d45,9007e0e25ba0667d X-Google-Attributes: gid111d45,public From: John P. McGrath <mcgrath@enter.net> Subject: Re: Problem with URL Date: 1999/11/04 Message-ID: <MPG.128afadbdcb5c4ad98968c@forums.borland.com> X-Deja-AN: 544285827 References: <7vpenn$c374@forums.borland.com> Organization: Another Netscape Collabra Server User Newsgroups: borland.public.jbuilder.java.swing