--- Yuet Sim Lee <[EMAIL PROTECTED]> wrote:
> Hi,
> 
> I knew that getImage() could
> load an image file from the
> network and paint() could
> display it.
> 
> However, I don't know how can I
> get an image which is a local
> file. I tried
> 
>  Image i = getImage( String filename )
> 
> It can not be compiled and the
> compiler said:
> 
> 
> Incompatible type for method. Can't convert
> java.lang.String to java.net.URL.
>     i = getImage("houses.gif");
> 

The format of getImage is getImage(URL) so you need to
say getImage(new URL("houses.gif")).

Ken
_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


----------------------------------------------------------------------
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to