Article View: borland.public.jbuilder.java.api
Article #3507Re: display images without jbcl
From: Rich Wilkman
Date: Wed, 10 Dec 1997 00:00
Date: Wed, 10 Dec 1997 00:00
35 lines
1312 bytes
1312 bytes
Thomas:
It won't work in applets in Netscape, but Component has a getResource()
mechansim that can be used. Something like:
URL url = this.getClass().getResource("image/ColoradoAvalanche.jpg");
theImage = getToolkit().createImage((ImageProducer)url.getContent());
mt = new MediaTracker(this);
mt.addImage(theImage,0);
try{
mt.waitForAll(0);
}
catch(Exception ex){
ex.printStackTrace();
}
In this case "this" refers to an Applet which is really a panel.
Components (and therefore Containers) also have createImage mechanisms
that you may wish to investigate. There are also Applet specific image
loading mechanisms.
-Rich
Thomas Franke wrote:
>
> I want to display GIFs within a panel without using imageControl or
> other jbcl components due to their
> enormous archive-size.
>
> Does anyone have any idea???
>
> Thomas
Technical Details
Message-ID:
<348ED7C6.A0F64CCC@corp.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<348E5B70.AC08B151@brockhaus-ag.de>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1089d0,6edee27a736f54f X-Google-Attributes: gid1089d0,public From: Rich Wilkman <rwilkman@corp.borland.com> Subject: Re: display images without jbcl Date: 1997/12/10 Message-ID: <348ED7C6.A0F64CCC@corp.borland.com> X-Deja-AN: 296971233 References: <348E5B70.AC08B151@brockhaus-ag.de> Organization: None Newsgroups: borland.public.jbuilder.java.api