Article View: borland.public.jbuilder.java.api
Article #2751Re: getImage is strange
From: Greg Hamer
Date: Fri, 19 May 2000 00:00
Date: Fri, 19 May 2000 00:00
27 lines
1388 bytes
1388 bytes
java.awt.MediaTracker exists for this purpose. The images width/height are
invalid until the image has been loaded, which in the case of an applet
could be awhile. MediaTracker allows you to wait until this has occured.
David Br๏ฟฝnnvall <david@strangnas.mail.telia.com> wrote in message
news:39256aab@dnews...
> Take a look at this:
>
> buttonimg = owner.getImage(owner.getCodeBase(),
> owner.getParameter("BUTTON"));
> int w = buttonimg.getWidth(this);
>
> why is w -1 here, and 437 later.
> when does buttonimg.getWidth(this) return the right value, is it possible
to
> wait until its correct?
>
> is it valid to do something like this:
>
> buttonimg = owner.getImage(owner.getCodeBase(),
> owner.getParameter("BUTTON"));
> while (buttonimg.getWidth(this) == -1 || buttonimg.getHeight(this)
== -1);
>
> or is there a better way?
>
>
Technical Details
Message-ID:
<8g3ted$ipl6@bornews.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<39256aab@dnews>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII X-Google-Thread: 1089d0,1aecdb5bb8b2e4b4 X-Google-Attributes: gid1089d0,public From: "Greg Hamer" <ghamer@corp.netzero.net> Subject: Re: getImage is strange Date: 2000/05/19 Message-ID: <8g3ted$ipl6@bornews.borland.com> X-Deja-AN: 625485891 References: <39256aab@dnews> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 Organization: Another Netscape Collabra Server User X-MSMail-Priority: Normal Newsgroups: borland.public.jbuilder.java.api