🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #8309

Re: DESPERATE !!!

#8309
From: Joi Ellis [TeamB]
Date: Thu, 29 Mar 2001 17:01
40 lines
1979 bytes
Carlos Ojea Castro <ccastro@rslcom.es> wrote:

> Hello :

> I don't understand anything !!.
> This peace of code in my paint() method draws a gif and
> a black rectangle :

>    TableroGif = getImage(getCodeBase(), "Tablero.gif");
>    Tablero_Buffer.drawImage (TableroGif, 0, 0, this);
>    Tablero_Buffer.fillRect(0,0,32,42);

> But this other code only draws the black rectangle, and
> not the image !!!! :

> if (TD)
> {
>    TableroGif = getImage(getCodeBase(), "Tablero.gif");
>    Tablero_Buffer.drawImage (TableroGif, 0, 0, this);
>    Tablero_Buffer.fillRect(0,0,32,42);
> }

> Of course TD is true. TD is a class variable.

Is that the exact code?

Two things I'd check for:

  Ensure the gif file has completely loaded before you attempt to display it.
There is an image loader class which tracks this for you.  

  Check the scope of your variables and make sure something isn't being
defined within the IF block and thus disappearing when the IF block scope
ends.

-- 
Joi Ellis (TeamB) 
No direct email, please.
For best results, post on news server newsgroups.borland.com!
Newsgroup Info: http://www.borland.com/newsgroups/guide.html
Technical Details
Message-ID: <3ac36a85_1@dnews>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!newsfeed.icl.net!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews!not-for-mail
References: <3AC361A6.21A4F47E@rslcom.es>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,e3fc9de084362442
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-03-29 09:36:20 PST
Message-ID: <3ac36a85_1@dnews>
From: "Joi Ellis [TeamB]" <joi@aravox.com>
Subject: Re: DESPERATE !!!
Newsgroups: borland.public.jbuilder.java.language
References: <3AC361A6.21A4F47E@rslcom.es>
User-Agent: tin/1.4.2-20000205 ("Possession") (UNIX) (Linux/2.2.16-3 (i686))
NNTP-Posting-Host: 209.46.41.66
Date: 29 Mar 2001 09:01:58 -0800
X-Trace: 29 Mar 2001 09:01:58 -0800, 209.46.41.66
Lines: 40
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-03!supernews.com!cyclone-sf.pbi.net!63.208.208.143!feed2.onemain.com!feed1.onemain.com!newsfeed.icl.net!news.algonet.se!algonet!newsfeed1.uni2.dk!newssuck.uni2.dk!dnews!not-for-mail